Change header when on home page
Since you have a static page as the front page, use is_front_page() instead of is_home() in the condition.
Since you have a static page as the front page, use is_front_page() instead of is_home() in the condition.
Try !is_front_page() Or is_front_page() But it depends on what the function is.
There are a few issues here, but I’m not sure that any one directly is your problem. First, you need to be more specific in your pre_get_posts callback conditional, to ensure you’re targeting only the main query. Second, you need to clarify the post type you’re intending to show. Third – and the one that … Read more
Under “Settings” -> “Reading” in the wp-admin you (or other users) can set which page should be used as the home page.
404 error on every post and page other than home
The easiest way to achieve this would be to use a custom post type. This way, these posts won’t show up as custom post types by default are excluded from the main query. You can just then create your page and create a custom query with WP_Query to pull in this 9 posts 1. CREATE … Read more
The $location parameter was incorrect. Try this: function redirect_to_local_110(){ wp_redirect( home_url() ); exit; } function add_home_link() { add_menu_page( ‘Course’, ‘Course’, ‘read’, ‘home’, ‘redirect_to_local_110’, ‘dashicons-welcome-learn-more’); } add_action( ‘admin_menu’, ‘add_home_link’, 1001 ); Or you could use this: function redirect_to_local_110(){ wp_redirect( ‘http://www.example.com’, 301 ); exit; } function add_home_link() { add_menu_page( ‘Course’, ‘Course’, ‘read’, ‘home’, ‘redirect_to_local_110’, ‘dashicons-welcome-learn-more’); } add_action( … Read more
if it is “a very complex theme,” then there’s probably some hook into template_redirect malfunctioning. as @TomJNowell mentioned, using home.php or front-page.php should allow you to override page.php, but that’s not always preferred (I rarely use them myself), and will not necessarily fix the problem. you don’t need to assign a blog page in order … Read more
Straight out of the Codex: $sticky = get_option( ‘sticky_posts’ ); $query = new WP_Query( ‘p=’ . $sticky[0] );
if you are just trying to put HTML inside PHP, just close PHP and wrap with HTML <?php if ( is_front_page() ) { ?> <div> HTML Code </div> <?php } ?> And use is_front_page