In the Shoestrap theme, you often change content by using hooks. I want to add the following to functions.php
but it doesn’t work…
// in functions.php
if ( is_home() ) {
add_action( 'shoestrap_below_top_navbar', 'my_custom_below_top_navbar' );
}
// also tried since we're before the loop
if ( 684 == get_queried_object_id() ) {
add_action( 'shoestrap_below_top_navbar', 'my_custom_below_top_navbar' );
}
// but get_queried_object_id() returns 0
I’m using WP 3.8. I found this bug report but it doesn’t seem to be quite the same issue since my page is just the home page, not a query page.
ps, if someone would like to create a shoestrap tag, please add it to this q.
I’m pretty sure you try to use this conditional tags to early, so they don’t work.
From Codex:
So what should you do?
Just put your code in some action, that is run later.
The other way to do this would be to add actions always and put conditional statements inside them: