Can’t access private custom posttype single- or archives-page
This seems like a similar question, but I’ll also put it here. ‘has_archive’ => ‘richards’ Then flush permalinks (Settings > Permalinks).
This seems like a similar question, but I’ll also put it here. ‘has_archive’ => ‘richards’ Then flush permalinks (Settings > Permalinks).
pre_get_posts lets you change what a query is meant to retrieve, but what you’ve done is essentially: Grab posts of type A, B, C, then remove all the posts with these IDs that just happen to be all the posts of type B When what your end result should be is: Grab posts of type … Read more
I believe the error lies in $topic_query[‘tax_query’] = $topic_tax_query; which should be $topic_query_args[‘tax_query’] = $topic_tax_query; A simple variable mixup, so your taxonomy query makes it into WP_Query.
The first parameter passed to register_post_type is the post type key which is used by the theme template hierarchy. register_post_type documentation. The cows.php is a page template, so to use it create a new page and select the ‘Cows’ template. You will need to alter the slug of this page so it doesn’t conflict with … Read more
Let’s say you have custom post types cpt_a, cpt_b, cpt_c. You could make an archive page for cpt_a: archive-cpt_a.php. Then after the main loop, you could make a second loop for cpt_b like this: $cpt_b = new WP_Query( array( ‘post_type’ => ‘cpt_b’, ‘posts_per_page’ => -1 ) ); while ( $cpt_b->have_posts() ) : $cpt_b->the_post(); the_title(); endwhile; … Read more
You can set any arbitrary path in the rewrite slug and has_archive arguments: $args = array( ‘rewrite’ => array(‘slug’ => ‘people/researchers’), ‘has_archive’ => ‘people/researchers’, // other args… ); EDIT Your post type slug is researchers, so WordPress will be looking for the file archive-researchers.php by default. If you want to force a different template, you … Read more
if you are not aware of WordPress template structure. https://developer.wordpress.org/themes/template-files-section/taxonomy-templates/ https://developer.wordpress.org/themes/basics/template-hierarchy/ WordPress follow a hierarchy for post/page templates archive.php for your archive pages of post and category. single.php for your every WordPress single post. you can adjust your single.php code to make single page HTML different then archive page. In your case to separate styling … Read more
It doesn’t use archive.php because it isn’t an archive example.com/?post_type=mycustom is still the homepage, but with an additional query parameter Instead, use the custom post type archive at example.com/mycustom/
There is a custom post type also called clients which is already using that slug. Try using a different slug/page name or work with the default archive page.
One option: revisions. If you save a large number of revisions for your pages, you can then browse through the revision history and “Preview” what a particular page looked like at a particular point in time. However, this requires whoever is viewing the past view to be logged in, since Previews are not public. Another … Read more