Don’t see add_filter result in the site front page
Don’t see add_filter result in the site front page
Don’t see add_filter result in the site front page
In your index template, you’ll want to add a conditional around your Google ad. The subject of that conditional is up to you, and will depend on your exact needs. For instance, if you want it to show on the homepage but not other pages, you can check if is_home(). If your needs are more … Read more
the_post() function is what advances the internal counter and loads the data for the next post. You’re calling it between the title and content: the_title(); the_post(); the_content(); You want to change the order and move it before the output of any of the other template tags: the_post(); the_title(); the_content();
I assume you have a file in templates/masterhead-templatename.php, and it works, it is ok. Correct me if I am wrong, you want to locate this file like this masterhead-templatename.php, basically one folder up, but this wordpress function does not work like this. If the file exists in the root’s theme folder, it does not recognize … Read more
For question as stated it would be easiest to retrieve page’s slug and pass it as second argument: get_template_part( ‘content’, get_post_field( ‘post_name’, get_post() ) ); Note that you would want to have generic content.php for pages that don’t have dedicated template (if any).
leanda reports that the problem has been resolved: Solved it by changing array_pop to array_shift.
Looking at the following source codes get_header() get_footer() get_template_part() you are going to have issues, more with your custom headers and footers. I do not know what portfolio is and how it will be used, so I cannot answers on that specific subject get_footer() and get_header() does not allow for custom headers and footers to … Read more
OK, so one simple way would be to edit your template, I assume header.php for where you want the menu to appear. Use the template include to load myfile.php get_template_part(‘template-parts/myfile’); Then inside myfile.php: <?php $search .= ‘<li class=”search”><form role=”search” method=”get” id=”searchform” action=”‘.home_url( “https://wordpress.stackexchange.com/” ).'”><input type=”text” value=”search” name=”s” id=”s” /><input type=”submit” id=”searchsubmit” value=”‘. esc_attr__(‘Search’) .'” /></form></li>’; … Read more
Codex has very decent explanation of get_template_part() logic: Assuming the theme folder is wp-content/themes, that the parent theme is twentyten, and the child theme is twentytenchild, then the following code — <?php get_template_part( ‘loop’, ‘index’ ); ?> will do a PHP require() for the named files in this order: wp-content/themes/twentytenchild/loop-index.php wp-content/themes/twentytenchild/loop.php wp-content/themes/twentyten/loop-index.php wp-content/themes/twentyten/loop.php Basically you … Read more
Why not use the body class to target these elements with CSS. You could do something like the following and make your PHP a little cleaner. .product-item{width:33%;} .home .product-item{width:25%;}