I have a simple function that I need to assign to a hook, and then have it appear only on the home page.
I just cannot seem to get it right.
add_action( 'woo_content_before', 'woo_add_home_slider' );
function woo_add_home_slider () {
if ( function_exists( 'soliloquy_slider' ) ) soliloquy_slider( '169' );
}
I need this to only show on my homepage.
To make your function display only on the home page, you would use the WordPress function is_home() and/or is_front_page, depending on your home page settings.
If your home page is set to list your blog posts, then this would be your solution:
If your home page is set to display a specific page:
Or, depending on your settings, you might be able to get the effect you want by combining the two with an or:
If your home page is set to list your blog posts, then this would be your solution:
Of course, you could combine the ifs into a single condition, like so: