@Broof: Thanks for reply, i know about this method, but i want to create my own SMTP sever on localhost, because my ISP SMTP server is not working. Hope u will understand the situation.
hi, i have created a wp theme, in which there is a built in jquery + php contact form. Now i want to check whether it is working fine or not, but i want to check this form on wamp local host. Is there any way to do this?
waiting for replies….
@LoewenWeb: thanks for reply, but unfortunately this key is also not working. Could you provide the complete example code + Api Key which is working on localhost?
Hi, Hope u people will be fine, i’m developing a theme on localhost. Now i want to implement Google Map by using its API in my theme Contact Page, i got API keys for both addresses http://localhost/ and http://127.0.0.1/, but no key is working, nothing appears on the screen.If you people know about its solution ,please let me know. Thanks in advance for your replies. Regards
hi srhnbr , i got the solution by google search. For other users i’m providing the link:
HI srhnbr thanks for reply again, i’ve used your provided code but nothing appears. However if i use this code in my template file (Outside the loop) i get some values like this:
stdClass Object ( [ID] => 4 [post_author] => 1 [post_date] => 2010-08-13 05:15:56 [post_date_gmt] => 2010-08-13 05:15:56 [post_content] => [post_title] => Blog [post_excerpt] => [post_status] => publish [comment_status] => open [ping_status] => open [post_password] => [post_name] => blog [to_ping] => [pinged] => [post_modified] => 2010-09-23 05:35:58 [post_modified_gmt] => 2010-09-23 05:35:58 [post_content_filtered] => [post_parent] => 0 [guid] => http://localhost/wordpress/?page_id=4 [menu_order] => 0 [post_type] => page [post_mime_type] => [comment_count] => 0 [ancestors] => Array ( ) [filter] => raw )
and infact my main problem is this that ,the same code working in template file does’nt work in my custom widget, and even code provided in my post # 4 in this thread can echo my current page ID in template file but not in custom widget.
Sorry there was a mistake in my previous code, i forgot to type “global $wp_query;” before this code. Now code is following:
<?php // Get Current Page ID outside Loop global $wp_query; $post_obj = $wp_query?>get_queried_object(); $Page_ID = $post_obj->ID; echo $Page_ID; ?>
But unfortunately this code is also not working, no result appear on the screen.
Hi srhnbr, thanks for reply.
i’m now using this code but it is not working:
<?php // Get Current Page ID outside Loop $post_obj = $wp_query?>get_queried_object(); $Page_ID = $post_obj->ID; echo $Page_ID; ?>
instead its giving an error that “Call to a member function get_queried_object() on a non-object in ….”
i shall be very thank full to you if you explain is some detail how to retrive current page id in my custom widget. Thanks again for your time. Regards
Hi, Hope u people will be fine, i am using current code in my template file (outside the loop) to retrieve current page id.
<?php // Get Current Page ID outside Loop global $post; $PageId = $post?>ID; echo $PageId; ?>
This code is working fine in my template file. But when i use the same code in my custom widget its displaying ‘0’ instead of giving current page id. I searched a lot in wordpress forum and through Google but all in vain. If u people know how to get page id in custom widget, please let me know. Thanks in advance for your replies. Regards
@luckykind: you rock. i just tried your suggested solution, its working fine. Although i still can’t understand the logic.