My current site has custom post types, that run of off the root domain, so anything created inside the CPT will be something like: domain.com/page-name/ rather than domain.com/custom-post-type-name/post-name/. With this, I want to update to WP 4.7 but I cannot because it breaks my website and the CPT's mess up.
Here's why I'm using custom post types, so I have this page template that pulls in everything related to that custom post type and displays those pages a list (similar to the blog page).
However, seeing as everything is of off the root. I was wondering if there was a way to customise Wordpress to give me the option to add a category to a PAGE, therefore, after I can create a code that will display all PAGES within that CATEGORY as a page template.
Reason for this, is will allow me to update to Wordpress 4.7 and not have 5-10 different CPT's as it just gets annoying clicking between the different custom post type labels in the backend.
If anyone has any ideas or know's off a plugin that will do this.
And maybe if some has the code to show all pages as a list, that sit under that category, that would be great - please share.
Thanks.
Update
Here's my code for loop:
<?php wp_reset_query(); ?>
<?php $query = new WP_Query( array( post_type=page, 'cat' => 541 ) ); ?>
have_posts() ) : while ( $query->have_posts() ) : $query->the_post(); ?>
<?php if(has_post_thumbnail()) {
the_post_thumbnail(array(150,150));
} else {
echo '<img class="alignleft" src="'.get_bloginfo("template_url").'/images/empty_150_150_thumb.gif" width="150" height="150" />';
}
?>
<div class="entry">
<h3 class="blog_header"><a href="<?php echo get_permalink() ?>" rel="bookmark" title="Permanent Link: <?php the_title(); ?>"><?php the_title(); ?></a></h3>
<?php the_excerpt(); ?>
<a class="button_link" href="<?php the_permalink(); ?>"><span>Read More</span></a>
</div>
</div>
I'm attempting to display the pages that have been added to that category within a loop. Is there something wrong with my loop?
Thanks.