Skip to main content

Questions tagged [custom-post-types]

Custom Post Types extend WordPress to support additional content.

Filter by
Sorted by
Tagged with
0 votes
1 answer
6k views

Why does 'exclude_from_search' exclude a custom post type from WP_Query?

In WP 3.1, it appears that setting 'exclude_from_search' = TRUE for a custom post type excludes the post type not just from searches on the front-end, but also from any post query using 'post_type' = '...
2 votes
1 answer
802 views

custom taxonomy and custom post type url conflict

i am having one serious url issue. there is news custom post type. it's slug is news. News taxonomy slug: news_category News taxonomy url is: http://domain.com/news_category/press-release i want ...
1 vote
1 answer
1k views

Add custom column to post list table

I have a custom post type called Book and I want to add the publisher and book author custom columns in the edit page. I also want to fetch a specific value from each fields (I created two fields ...
2 votes
1 answer
741 views

How to add custom taxonomy slug in CPT permalink?

This is the code i have until now to add a CPT articles and taxonomy articles-category. The code works, sort off. The pages are displaing correct (when i access them directly): articles/ articles/...
0 votes
1 answer
3k views

How to pass taxonomy terms to WP_Query along with $args?

I created a cpt and custom taxonomy associated with it. Lets say custom taxonomy name is Sports. I added terms to it - football, basketball. Now, i want to fetch post titles tagged under football ...
0 votes
1 answer
1k views

Create Second Search Page Only for Custom Post Type

I created a custom post type that will not be displayed anywhere on the site. However, I want to access the data from a search form. Because there will be a lot of pages, I need to disable the post ...
0 votes
0 answers
25 views

WordPress Pods - two posts from the same Custom Post Type but different slugs [closed]

I created a custom post type with Pods plugin called "Programs" and rewrote the slug to "programs". I need posts created in "Programs" to have different slugs. Example: ...
0 votes
2 answers
22 views

fetch from an external api call and display results in page

I have placed my external api call inside the functions.php file in the server and I created a shortcode for the api call. I'm familiar with React and I was expecting Wordpress to be somewhat similar. ...
0 votes
2 answers
19 views

How to get Custom Post Type (CPT) Archive Page's Posts Featured Images Preload in header.php

I am trying to Preload all Images of the Custom Post Type Archive Page's Posts Featured Images Only. Mean in header.php I want to set code in and implementation should only be on the Custom Archive ...
0 votes
1 answer
13 views

Editor or custom field for Latex source code page

I plan to publish latex code on WordPress. My VPS has a full installation of texlive and my WordPress will call xelatex or pdflatex to generate pdf, and my WordPress will also call pandoc to generate ...
0 votes
1 answer
1k views

Custom post type archive pagination with HTML5Blank theme?

Can't get the pagination to work. Here's my archive-work.php: <?php get_header(); ?> <main role="main"> <!-- section --> <section> <h1>&...
1 vote
1 answer
2k views

Multiple tag cloud filtering

I am writing a plugin which creates a custom post type and two associated custom taxonomies. The custom post type list/archive page should be filterable by terms in one or both taxonomies i.e not just ...
0 votes
1 answer
32 views

WordPress CPT & Custom Taxonomy with the SAME Permalink Structure

I have a CPT: 'Guide' and Custom Taxonomy 'Guide Category'. What I want to achieve is: The CPT permalink structure is: example.com/guides/custom-taxonomy/post-name/ So that the following should ...
0 votes
2 answers
818 views

How do I Create Single template for custom post type with a custom URL?

I have a live website that is using the custom post type "virtual-programs" and I have a template that currently works called single-virtual-program.twig and single-virtual-program.php. I am ...
0 votes
1 answer
696 views

Ordering Post by Meta Key (Not Working)

So I've read all the stack exchange posts on this, and I feel like what I have, based on what I've read, should be working. I'm a little confused as to why it isn't. $args = array( 'post_type' =&...
0 votes
1 answer
1k views

How can I create a button that when clicked populates a div with a list of foods that are checked as a certain type of ACF?

I have not asked any questions here before so I'm sorry if I do it wrong. I am new to custom theme template files. I am new to wordpress and php also. This is a learning exercise for me. I am making a ...
0 votes
1 answer
2k views

How to override post-new.php with custom template

How can i override post-new.php with my custom template. When i include file or simply redirect i see my template but admin sidebar is missing. I know it is not simple.
0 votes
1 answer
1k views

Display custom post types in dropdown with option "all"

wp_dropdown_categories() function has an argument show_option_all to search in all terms if selected. I need something similar in my custom post type select: <form method="GET" action=&...
0 votes
2 answers
969 views

Show first posts with custom field not empty and order all by title

I have a custom post type called "products". My goal is to make my custom query that I have on homepage and also the search query show first the posts that have a custom field called "id_number" not ...
8 votes
4 answers
32k views

How to order posts of a custom post type by date DESC in dashboard Admin?

I created a new post type named "Video". When I create post for the post type, posts is ordered by title ASC. Is it possible to order posts by date DESC please ? register_post_type('Videos', array(...
1 vote
3 answers
2k views

Pagination of Custom Post Types not Changing Posts

I have a custom post type, jobs, being displayed on an external page using WP_Query() - the query itself is working fine. However when I try to paginate the results, the older/newer links show up, ...
1 vote
2 answers
2k views

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 ...
0 votes
1 answer
1k views

group posts by month/date ignore years

Need group posts from custom post type by post date. Example: Jan (all posts posted in januar for all years 2010,2011 ... 2015) 1 (all posts posted in 1 januar for all years 2010,2011 ... 2015) POST1 ...
0 votes
2 answers
863 views

How to add pagination to a post loop in a custom BuddyPress tab

I created a new tab called "Videos" inside of the BuddyPress Profile page. This tab contains all video posts added by that user. The problem is that it only shows the first 12 posts and the pagination ...
0 votes
1 answer
981 views

Wordpress Custom Post Type - Post Attribute: Template. Template shows up and saves on the back end, but the default theme file is being rendered

Edit: Now I've found that this is Hybrid Core, and apparently the template hierarchy is different. I still haven't solved my problem below though. In addition to the title. My thinking is that if I ...
1 vote
1 answer
688 views

Form action/link to render a plugin in WordPress front-end

I am new to WordPress and I'm wondering if anyone could help me understand how I should go for rendering the output of a plugin when a form of a widget is submitted in the front-end. I'm developing a ...
1 vote
2 answers
2k views

Modify wp_title for custom post types using custom fields data?

Trying to modify the output of the WP_Title through a custom post type with a filter. I've had no issues doing it to the_title but I assume as the wp_title function is called through the header it's ...
0 votes
2 answers
3k views

How to disable Publish button on Edit post if post title exists

I want to ask a question: I have a source code, it only works for the post-new, but not edit post. So how to disable Publish button on Edit post if post title exists? add_action('wp_ajax_check-posts-...
0 votes
1 answer
1k views

load wordpress events into full calendar jquery

I am trying to load my custom post type events into jquery plugin full calendar but nothing is working. I have made a php file with this code include "wp-load.php"; global $wpdb; header('Content-...
0 votes
1 answer
690 views

Automatically add CPT UI categories to the menu

I have created a CPT UI and selected built in taxonomies "categories (WP CORE)". I have added some records and every time I add a category and main record, I want them to display in the main menu ...
0 votes
2 answers
2k views

Read-Only custom post type

For the contact form of my own theme I have created a Custom Post Type in which the messages of the users are automatically stored. In the administration area the messages can be read similar to ...
0 votes
2 answers
931 views

custom post type single post preview for pending status

I have created custom post type and created the post in a front custom form using logged in user and set status 'pending'. Now I want to show my created post preview like the published post. I have ...
0 votes
1 answer
735 views

How to make a custom search template for custom taxonomy?

I have created the custom post type "truck" with custom post type ui plugin. I then created a couple of custom taxonomies "make" and "model". I am using Advanced Custom Fields in the templates to ...
0 votes
3 answers
693 views

Wordpress Custom post type slug rewrite

I want to rewrite custom post type slug. I used this snippet. but not working. add_filter( 'register_post_type_args', 'wpse247328_register_post_type_args', 10, 2 ); function ...
0 votes
1 answer
1k views

How do I link to a dynamic ACF button from a Custom Post type?

I have a custom post type archive that has articles that call some ACF content on each post. I've used WP_Query to pull these articles onto the archive page, and there's a button in each article that ...
0 votes
1 answer
689 views

Query events post type after current date and timezone

So I am making changes to a clients website and currently they have an events post type with some custom fields that allow them to set an events end date/time and the events timezone. The custom ...
0 votes
1 answer
692 views

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 ...
0 votes
1 answer
2k views

"A post type mismatch has been detected" Error when updating custom post

I have started getting this error when updating a custom post type on a clients site. I've never seen this error before and can't find any reference to it in Google search. Can anyone point me in ...
0 votes
1 answer
832 views

Rest Api not working with Iframe in form data

I have created one api with post request. register_rest_route('myapi/v1', '/post_flyer', array( 'methods' => 'POST', 'callback' => 'api_post_flyer', )); I have to submit ...
2 votes
1 answer
2k views

set and unset the custom field value

While showing all the posts together in admin panel, I have a custom column 'Featured Image'. And this column has a value YesOrNO. To set the column name : I have inside functions.php: function ...
1 vote
1 answer
3k views

Displaying custom-taxonomy-terms sorted by parent/child-hierarchy?

I have a custom post type with a custom taxonomy (to show some "best practice" examples on my website). On the single-post-page (single-bestpractice.php) I wanted to show all the terms (categories) ...
3 votes
2 answers
1k views

Parent page for CPT

Alright, there's been numerous topics about this, but it doesn't seem to work for me. I have one normal page, called "Resources". Then I have several Custom Post Types. One of which is "...
18 votes
7 answers
28k views

Is it possible to get_terms by taxonomy AND post_type?

I have 2 custom post types 'bookmarks' and 'snippets' and a shared taxonomy 'tag'. I can generate a list of all terms in the taxonomy with get_terms(), but I can't figure out how to limit the list to ...
0 votes
1 answer
6k views

Sort by date, then by time

We have "events" that are specific dates, so the page is set to put the events based on the day of the event first - then they should be sorted by the time the event takes place. The dates are fine --...
2 votes
6 answers
4k views

Add custom post type archives to search results?

How do I get WP search results to include custom post type (CPT) archives? For example, if I have CPT 'career' whose title (in the template php) is 'Careers', how do I get search results to include ...
4 votes
8 answers
20k views

How to list custom taxonomy terms without the hyperlinks?

I've searched far and wide to try and find an answer to my question. I'm hoping I can get help here. Here goes... I'm currently retrieving the terms of my custom taxonomy using: <?php echo ...
3 votes
3 answers
911 views

Unable to get wp_redirect() working after adding a CPT via the front end

I am attempting to learn PHP by creating a relatively simple application built on wordpress, it is a basic CRM and I've made decent progress but have been stuck on some of the finer points. I've been ...
1 vote
2 answers
1k views

Custom post type / taxonomy rewrite archive page 2 gives 404

I've followed the code based off this and everything is working perfectly -How to create a permalink structure with custom taxonomies and custom post types like base-name/parent-tax/child-tax/custom-...
0 votes
1 answer
17 views

My custom meta box with textarea field not saved

I created a custom meta box for my custom post type with address, phone, and map but only the map field type textarea not saved. My code here: // Add meta box function vn_store_add_meta_box() { ...
0 votes
2 answers
17 views

How to build help pages similar to Wordpress Developer Resources

We need to build a help page similar to Wordpress Developer Resources (see the screenshot below). We're problably looking for a developer solution as we haven't found any plugin that would fit our ...

1
2 3 4 5
208