I have create a simple WordPress plugin. For showing it on pages I have call function by using this
function facebook_live_counter_main_content(){
[html markups here]
add_action ('wp_head', 'facebook_live_counter_main_content');
It’s work properly. But I want to show the plugin actions home page only. I need help by you how can I call the function for show the plugin actions home page only.
Regards-
Faysal Imran
The correct function depends on your settings under
Admin > Settings > Reading > Front page displays
. If you have selected…“A static page“
is_home()
oris_front_page()
to returntrue
.“Your latest posts“
is_front_page()
to returntrue
.The
is_home()
function will returntrue
if the current page is the home page, but not if your front page is a list of your latest posts. If you have selected “Your latest posts” underAdmin > Settings > Reading > Front page displays
you should useis_front_page()
to returntrue
regardless of if the frontpage is a page or post listings.http://codex.wordpress.org/Function_Reference/is_front_page
http://codex.wordpress.org/Function_Reference/is_home