is_home() and is_front_page() not working in sidebar
I was having the same issue but found an anwser that worked for me. When you use wp_reset_query(); before you use is_home(); or is_front_page(); it will work just fine.
I was having the same issue but found an anwser that worked for me. When you use wp_reset_query(); before you use is_home(); or is_front_page(); it will work just fine.
For that you can create two templates and assign both templates to both pages. Add those pages to menu and give them both the label Home. Now its working like your site has a two home pages.
Option 1: Edit the Contructor theme The Constuctor theme checks the theme options and then includes the home link based on the option value. The code that adds the Home link is located in /wp-content/themes/Constructor/libs/Constructor/Main.php. // show link to homepage if ($this->_options[‘menu’][‘home’]) { echo ‘<li id=”home”><a href=”‘.home_url().”https://wordpress.stackexchange.com/” title=”‘.get_bloginfo(‘name’).'”>’.__(‘Home’, ‘constructor’).'</a></li>’; } Link Text To change the … Read more
Using pre_get_posts to filter by custom fields while using static front page
You can check for is_home() and is_front_page() inside of your filter: add_filter( ‘the_content’, function( $content ) { if ( ! is_home() and ! is_front_page() ) return $content; return ‘Home, sweet home!<br>’ . $content; });
Turns out since the plugin output in the footer I just had to reset the query: wp_reset_query();
i did find my answer here : http://www.wpbeginner.com/wp-themes/how-to-add-custom-items-to-specific-wordpress-menus/ add_filter( ‘wp_nav_menu_items’, ‘your_custom_menu_item’, 10, 2 ); function your_custom_menu_item ( $items, $args ) { if (is_single() && $args->theme_location == ‘primary’) { $items .= ‘<li>Show whatever</li>’; } return $items; }
Only homepage working correctly, 404 error on everything else
There are ways to write the code more efficiently, though not necessarily WordPress-specific. Only pass necessary args to your get_posts() calls The only critical args you need are posts_per_page and category; you can omit the rest Make an array of category IDs, and loop through the array Loop through an array of category IDs, so … Read more
The issue is not in how your site is coded or operated, but in how Google decides to show their search results. When the homepage is pulled up, sometimes they’ll show recent posts below it, but often won’t show your author information next to it, because the same author has already been shown above. So … Read more