Custom post type archive page pagination

I have set up an archive page for my custom post type reference, where I use a query to get all posts of type reference. This works, but when I try to paginate the result, it doesn't work. Right now, it doesn't even print out the pagination links. EDIT: This was earlier used on a regular page, but I changed it to an archive page. That's when the pagination broke. Here is the source code; Custom post type reference (plugin) …
Category: Web

Rewriting archive page slug to be different than custom post type slug

I am having trouble changing the slug of my archive page. The goal is to create a page that can be edited from the back end of WP with the slug speakers, but that has already been taken by the archive page. This has to be client friendly so it can't be only editable in the php. I am willing to do whatever anyone thinks is the best idea for this. Ideas: removing the archive page all together rewriting the …
Category: Web

title tag for custom post type remove taxonomy name from title tag

So it appears I am missing a vital pice of information somehow to make my custom post type title tag behave. everything else works fine. my current - simple - scenario is this : wordpress 3.8, twentytwelve theme, wpizza plugin (I'm the author of this , so that's what the questions relates to really), nothing else I registered the wppizza custom post type and taxonomies like so: /******************************************************* [register custom post type] ******************************************************/ public function wppizza_register_custom_posttypes(){ $labels = array( 'name' …
Category: Web

Custom post type is showing custom home page, not archive page

I have a custom post type set up (two, actually) that are not displaying properly. I am hoping that it is the same issue with both post types. Here is my code for one of the post types (portfolio). The second is quite similar. <?php add_action('init', 'ccd_portfolio'); function ccd_portfolio() { $labels = array( 'name' => _x('Portfolio', 'post type general name'), 'singular_name' => _x('Project', 'post type singular name'), 'add_new' => _x('Add New', 'ccd_portfolio item'), 'add_new_item' => __('Add New Project'), 'edit_item' => …
Category: Web

Pagination not working past page 3 on archive page of category

I have a custom post type of "show" and within that custom post type I have set up a taxonomy / category called "venue" which has two options "venue-one" and "venue-two" (slugs). On the two archive pages I have set up, where each shows all posts from "venue-one" or "venue-two", pagination is not working past page 3. I am using numbered pagination and visually it does display what the correct number of pages should be (given what I set posts …
Category: Web

CPT archive with WP native/core tax/categories

So for some reason this is oddly difficult. I need to have a CPT which uses the core categories between the CPT reviews and core posts as news. I've tried getting the CPT archives as just URL which is fine until you try to access by category which fails such as /reviews/cpu_mainboard or /reviews/category/cpu_mainboard. Next up I tried a custom page template with the query in place and pagination. This worked, but 404's on the paginated results like this: https://stackoverflow.com/questions/41738362/how-to-include-pagination-in-a-wordpress-custom-post-type-query …
Category: Web

How to set a 'page' as parent of a custom post type?

For various reasons, I would like to use a 'page' in preference to an archive page for one of our custom post types and have this be reflected in the permalink structure. I am struggling to find out exactly how to do this. What needs to be achieved is a permalink structure that, when viewing a custom post, show as: mysite.com/[page-name]/[custom-post-type-single] I'd be extremely grateful for any help that can be offered. NB I have tried the Post Type Parents …
Category: Web

Custom post archive page not opening 404 page

I have custom post type like this register_post_type( 'workforce_archive', array( 'labels' => array( 'name' => __( 'Workforce Archives' ), 'singular_name' => __( 'Workforce Archive' ) ), 'public' => true, 'has_archive' => true, 'rewrite' => array('slug' => 'workforce_archive'), 'show_in_rest' => true, 'show_in_menu' => false, 'supports' => [ 'title', 'editor', 'author' ] ) ); And also have a file archive-workforce_archives.php but still I am getting 404 page when visit this URL "http://taliestrategies.local/workforce_archives". Any help is appreciated. Thanks
Category: Web

is there a way of getting term children that only shows those from two taxonomies

hi so I am trying to list the terms ( product categories ) but only those that exist in another custom taxonomy, say 'workplaces'. I have the below code that does this, but without taking into account the custom taxonomy archive object ID. I can't seem to figure it out if anyone has any insight it would be very helpful. thank you /** * gets term children, but not specific to custom taxonomy */ $term_id = 595; $taxonomy_name = 'product_cat'; …
Category: Web

wp-query and wp_get_post_terms on custom taxonomy archive page

hi so I am just wondering how I can increment the pagination of a page based upon the terms found with wp_get_post_terms() rather than the post count for the page. this is the process i have: custom taxonomy archive page by default presents posts ( products ) associated with that taxonomy i alter the loop with wp query to find categories & subcategories for each post. I then present the categories instead of the posts. I also try to remove …
Category: Web

Display a custom posts page for post type

In the pages editor Wordpress now displays " - Home Page", and " - Posts Page" next to the respective pages. If I go to edit Posts page a notice reads: You are currently editing the page that shows your latest posts. If I add a custom post type with an archive template is there a way I can recreate this behaviour for the custom posts? e.g. Suppose I have "videos" as a custom post type. I'd like a page …
Category: Web

Display All Courses in Course Archive Page

I am Developing Course Management Website. I have main post type Course, under Course I have different taxonomies like Institution, Location, Course Type and etc.. The problem is, if one Course selected to particular Institution that post displaying, but I need to display that particular Course again with different Institution, if I select different Institution. How would I do that? This is my Course archive page code, <div class="container"> <div class="row"> <?php $argsCourse = array( 'posts_per_page' => '-1', 'post_type' => …
Category: Web

Display Custom Post Type Archive content with Shortcode

So I've created a custom post type filled with Advanced Custom Fields only. There is no "content". I've created a single-custom.php, content-custom.php and archive-custom.php. All looking nice and working perfect. What I would like to achieve is to create a shortcode (I believe) for the archive-custom.php, so I can display the content of the archive-custom.php content on another part of my website, let's say on two different pages, with additional content. At first i thought i create a short code …
Category: Web

Pagination not working on my archive page for a custom post type

First off I have a custom post type called events, and I wrote a custom query in in my archive-events.php file. Everything is working great except for the pagination. To trouble shoot I stripped everything out except for the essentials and pagination was working Perfectly. After a lot of googling I think my issue might be that I need to write my query as a function in the functions.php file. Something like this: function set_posts_per_page_for_events_cpt( $query ) { if ( …
Category: Web

Archive page of CPT's custom Taxonomy

I have a Custom Post Type: "Sponsors" Sponsors have a Custom Taxonomy: "Sponsor Ranks" Sponsor Ranks are divided like Platinum Sponsors - Gold Sponsors - Silver Sponsors and so on I want to make an archive page that will show me all sponsors within their respected rank Currently I have something that works perfectly fine but I am unsure if this is the right way. I am basically making a new query every time, that doesn't feel right. <div class="row"> …
Category: Web

Getting Same Description in All the Custom Taxonomy Posts

I have developed a custom taxonomy post type. I have displayed categories & inside categories posts/(products). I am getting the Post title & Image as they should be (which I add), but the descriptions of all the posts are same. I have no idea why same desc keeps displaying,even though everything else is dynamic. Here is the code I am using: $taxID = get_queried_object()->term_id; $args = array( 'post_type' => 'industrial_product', 'fields' => 'ids', 'posts_per_page' => -1, 'tax_query' => array( array( …
Category: Web

How can I combine Wordpress default Tags and bbPress tags into one archive page?

I'm trying to figure out how to combine two taxonomies? I've got three things going on: Tags from Buddyboss's Forums (Buddypress/bbpress) Tags from The Events Calendar Pro Tags from Wordpress's WP_TAGS The events calendar uses the standard WP_TAGS that Wordpress blog posts also use, but the forums have their own tag type. I'd like to combine the tags so that clicking the same word takes you to one page, with forum discussions, blog posts, and events related to that tag. …
Category: Web

Custom post type archive page blank

I created a CPT with slug plist via cutom plugin I made. In my local host the archive work but in live server it return blank page. Here is the 'include' archive page code /** * Add Price List archive template * @since 1.0.0 */ add_filter( 'archive_template', 'get_plist_archive_template' ) ; function get_plist_archive_template( $archive_template ) { global $post; if ( is_post_type_archive ( 'plist' ) ) { $archive_template = dirname( __FILE__ ) . '\partials\archive-plist.php'; } return $archive_template; } Link: http://cratetimer.com/plist/ Also this …
Category: Web

Display only post types that are direct children of the current taxonomy

I have a hieratical category structure using Taxonomies, with a custom post displayed within them. Currently the higher level categories display all the posts that are in their child categories. How do I make it only list from the current category only and not their children. I'm currently using the default code. <?php if (have_posts()) : while (have_posts()) : the_post(); ?> I'm not a programmer and have not been ably to find anything with an exact or close enough match …
Category: Web

Invalid content when I try to import custom post type from the old template wordpress

I changed my wordpress theme on December 2021, and Im still trying to import the custom post types of my old theme to my new one.Ive tried like 5 times, the only thing that is importing is the multimedia, and appears this about importing the posts: Failed to import "XXX": especiais_post is invalid content type Do you guys have any clue about whats going on?? Please, help me!
Category: Web

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.