I am creating my own theme and was wondering if there is a way to remove get_template_part()
when you're on a specific page? For example:
<?php
if ( is_page('blog') ) {
[Remove]get_template_part('the', 'blog');
}
?>
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It only takes a minute to sign up.
Sign up to join this communityyou could do it the opposite way:
<?php
if ( !is_page('blog') ) {
get_template_part('the', 'blog');
}
?>
this would make it show up on all pages but the blog.
So I can think of a couple of ways at least:
get_template_part
, and assign that template to pages you create in WP. (solution for multiple pages of the same type)get_template_part
Does that answer your question?