Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Custom Post Types extend the WordPress back-end to support additional, non-Post content.

0
votes
0answers
6 views

Request filter query variables different on sites within multisite

I have a multisite setup, and I used the request filter from the Wordpress API (https://codex.wordpress.org/Plugin_API/Filter_Reference/request) to try to alter a query before a page load, and I took ...
0
votes
0answers
9 views

Widget PHP code isn't working

So I have a custom post type, and a php code widget that is connect to said post type and updates every time there is a new post in that type, but it's supposed to redirect when the display on the ...
0
votes
1answer
22 views

Run shortcode in custom script in wp_head if post type is CPT 'Jobs'

i am using genesis framework and types plugin. i create post meta fields for a custom post type name 'jobs' i want to run a custom javascript named jobpostingschema.js in wp_head if post type is ...
0
votes
0answers
28 views

CPT post doesnt shows tags and category on backend

i updated theme and plugin in staging site to live site. now i have this error as shown below in all post type. help me please.
1
vote
1answer
42 views

How to check the terms in single custom post type template

I have custom post type called events it has event_type taxonomy with two terms namely past-events, upcoming-events. I want to check my single post's term whether it's under past-events or upcoming-...
0
votes
1answer
22 views

Custom WordPress Pages

Recently, I have started developing a WordPress Events plugin as none of the off-the-shelf ones met the specific criteria for this project. I have ended up creating a few database tables for tracking ...
0
votes
0answers
18 views

WP_Query based on 's' and tax_queries

I have a search form for CPT. Basically search use 's' parameter of WP_Query args. $args['s'] = $search_title; It works pretty nice, but I need to extend search results by searching in taxonomies ...
0
votes
0answers
13 views

Custom Taxonomy - Using URL Parameters to Filter Posts

Whenever I try to filter my search results with two child categories of different parents, under the same taxonomy, I get this: /?selected-categories-industry=18&selected-categories-region=18-64 ...
0
votes
1answer
14 views

Custom Search form not working in localhost

This was the solution that i got from @Ray Gulick for having a custom search form for custom post type. This works fine in hosting service but fails in localhost as the form action is added as action=...
0
votes
1answer
17 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
0answers
11 views

How do I display a random “custom post” that will last for a specified amount of time without repeating content?

I saw someone else's question, but it was posted over seven years ago, and I am not very savvy about changes that may have occurred that would render the solution useless. I have several different ...
1
vote
1answer
24 views

How to search CPT's by meta query from the admin dashboard?

I feel like I'm missing something really obvious, but I've looked and can't figure this out. I have a CPT (request_form) and I need to perform searches on meta queries (wp_postmeta) rather than the ...
0
votes
0answers
22 views

How do I safely separate a custom portfolio type that was developed inside a theme?

I am working on a website that is using the theme Nordic. I am preparing to develop a new template for this website, but I have a problem: the entire content of the site was created on a custom ...
0
votes
1answer
30 views

Custom permalink not working and showing 404 page not error

I have created 1 custom post and some custom fields. Custom post type: Tour Custom field: tour_id Now I want to customize permalink link structure, want to append "tour_id" value in link. I'm ...
0
votes
1answer
13 views

I cannot display custom posts in custom taxonomy

I have a problem with display posts in custom taxonomy. I created custom post type m_product and custom taxonomy for this post type m_product_category. I created file in main theme folder named ...
0
votes
1answer
20 views

get_post_meta not working with variable as a post_id for dynamically get the postid

I would like to use the get_post_meta to pull a value from a CPT dynamically and then send a email. The problem is that the get_post_meta($post->ID, ... part of the code does not pull the email ...
0
votes
1answer
13 views

Permalink misbehaving in Custom Post Types

I have a post type named careers which is, function do_careers() { register_post_type('Careers', array( 'labels' => array( 'name' => 'Careers', 'singular_name' => '...
1
vote
1answer
25 views

Custom post type as home page with custom url

I've changed the permalinks to add a string at the beginning of the url like this: /london/%postname%/ This works perfect for all the pages but not for my home page. I set my home page to be a single ...
0
votes
1answer
14 views

Function tied to woocommerce_payment_complete_order_status blocks “processing” order status

I'm tying a function in to woocommerce_payment_complete_order_status that creates a custom post based on whether or not a coupon is used to place an order. The code all works fine- creates the post, ...
1
vote
1answer
16 views

How do I set all of a particular post meta to a value within the custom post type I'm in?

I've currently got a custom checkbox that (if checked) sets a particular post as 'featured'. It also set all other posts as 'unfeatured', just before setting the current post. This has worked great, ...
1
vote
0answers
19 views

Check Title Unique Or Not and If not error message and dont save

i am get tired from searching 2 days for what i wanna i have 'area' custom post type have Title and another field i wanna the title of area is unique if the user enter title 'area1' and this title ...
0
votes
0answers
21 views

Set archive of custom post type like 'posts' page in reading settings is set

I'm starting development on a WordPress site soon. For a specific post type, they want the archive to be part of the page structure. For the default post type, you can set the archive to a static ...
0
votes
1answer
17 views

Publish metabox postition?

On my custom post type when browsing the site on mobile the Publish metabox will land above other metaboxes. I have changed the position and priority of almost all metaboxes to counter this issue. But ...
0
votes
1answer
19 views

Counts Posts ( custom post type ) by Author in author.php

Here is the code that I use to counts posts for one post_type, I would like to use multiple post_type ( post_type_1, post_type_2... ) anyone can help me doing this ? Thanks for the help. <?php ...
0
votes
0answers
12 views

CPT Text search with wp_dropdown_categories is not working well, return false result

Please review my code, I want to search custom post type text with drop-down. <form id="searchform" method="get" action="<?php bloginfo('url'); ?>"> <input type="text" ...
0
votes
0answers
12 views

Custom Sort Order for looping through Taxonomy

I'm looping through all categories for a custom post type. What I'm trying to do is manually set the order for the loop by taxonomy id: My current format is: $categories = get_terms( '...
0
votes
0answers
8 views

Get an array of all the categories and sub-categories of a custom taxonomy

I have a custom post type "apis". This post type has a custom taxonomy "api_category" which has categories and subcategories. What I need to do is get an array of all the categories in this custom ...
0
votes
1answer
31 views

How to change URL structure for custom post type in wordpress? Custom taxonomy + custom Post name

I want to change the url structure for custom post type post type --> movies This url structure sitename.com/movies/post-name need to change sitename.com/custom-taxonomy/movies/post-name /%...
0
votes
0answers
9 views

How retrieve custom meta box user input value to another admin page

In my plugin I made a custom metabox, inside metabox have a input field(users can submit) , I think i need to use post id it's a custom post type called products. I did it many ways but it's not ...
0
votes
0answers
8 views

How to send the file in archive directory after import is complete

Currently I am using Wp all import plugin.Now I want to send the file in archive directory after Import is complete.Give me the solution as soon as possible. Thanks
0
votes
1answer
27 views

Post display in separate page [duplicate]

I have post my post in two different pages. One is News and the other is Blog. However, all my posts go to News page insead. My Blog is a hidden page, it will not display in the menu. This is more for ...
-1
votes
1answer
91 views

wp_dropdown_categories() searching is not working with CPT, please review my code

Searching is not working with CPT with custom taxonomy <form id="searchform" method="get" action="<?php bloginfo('url'); ?>"> <input type="text" name="s" id="s" size="15" /> ...
0
votes
0answers
21 views

How to Upload image and show in page in wordpress customPostType?

Iam new in wordpress Theme development ,I have made a custom Post for image upload . The code in functions.php is here: register_post_type('features1', array( 'labels' => ...
0
votes
0answers
18 views

Check if pods taxonomy has terms

I have a pods "newsroom" and a related taxonomy "newsroom_category". Within the 'newsroom_category", I currently have 3 fields: "media", "press_release", "others". When a post is viewed, they'd see ...
1
vote
1answer
55 views

Wordpress showing archive.php instead page

I have a problem with same name (slug) for category and page and wordpress is showing archive.php instead page custom template. Permalinks settings for category is . and i want to stay this way but ...
0
votes
0answers
12 views

Routing for a post type archive with custom taxonomy as a url parameter

Essentially, I have a custom post type product and it uses a taxonomy product-categories. I currently have my routing configured to use the top level category as part of a product url, e.g products/...
0
votes
0answers
9 views

Custom post type categories giving 404

I have a custom post type called "News" which looks like this: /** * Register "News" custom post type */ function news_custom_post_type() { $labels = array( 'name' =&...
0
votes
1answer
26 views

Custom Post Type author filter not working

I have 2 custom post types. Let's call them: CPT1 = movies CPT2 = actors When on the admin CPT post list, clicking on the author name gets me to: edit.php?post_type=movies&author=5 This ...
0
votes
0answers
20 views

Wordpress custom post type custom post status not displaying in edit.php

I can't get custom post status to show on the edit.php page with others statuses. even though i changed properties posts to post type 'inactive' which i registered as follows <?php new ...
0
votes
1answer
12 views

Problem adding column to WC Subscription

I am having trouble adding custom column to Woocommerce Subscription. My codes are as below: add_filter( 'manage_shop_subscription_posts_columns', function ($columns) { $columns['my_field'] = __(...
0
votes
0answers
22 views

Add Next/Previous links for Multiple Custom Post Types sorted by a meta value

We have 5 custom post types (places, portraits, figures, essays, early-work) sorted by a meta key year_completed (an advanced custom field). Is it possible to add a next and previous link to the ...
0
votes
1answer
8 views

Widget Categories shows “No categories”

I have a custom post type called "News" which looks like this: /** * Register "News" custom post type */ function news_custom_post_type() { $labels = array( 'name' =&...
-1
votes
0answers
25 views

Sort-able custom fields

I am trying to solve the case below. I have done the ajax part i am able to save the sorting order in the backend. But how can i update the front end layout based on the sorting i did in backend admin ...
0
votes
1answer
30 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 ...
0
votes
0answers
14 views

make pagination on single-gallery with content from meta value

I have a file single-gallery and this content is image from meta_value , and i want make pagination for limit show image per page on all post , this my code $paged = (get_query_var('page')) ? ...
3
votes
2answers
96 views

Is it possible to remove the posts_per_page limit on a specific post type?

I'd like to know if I can remove the limit on the posts_per_page for a specific post type. In the archive.php page I'm displaying different post type, and for the specific "publications" post type I ...
0
votes
0answers
11 views

Custom taxonomy for custom post type permalink and archive page

I have 3 custom post type which all have custom a define taxonomy. For example for the first post type publications i have the custom taxonomy publications_types. The URL structure is thus as ...
0
votes
0answers
17 views

How to access ACF fields in Elementor templates?

I am creating a custom archive page for a custom post type, but I need to get some Advanced Custom Fields (ACF) values into it. Is there a way to do that when building a template? For some reason, my ...
0
votes
0answers
5 views

WordPress TinyMCE Editor not handling preformatted code text correctly in Custom Post Types

I've hit a brick wall that I cannot solve or find anything on the net. Using custom post types whenever I add preformatted code snippets the editor does not process it correctly, even when using text....
0
votes
0answers
22 views

Different language for each Custom Post Type

I doubt this method, check is that true? Imagine we have a wordpress in English language that have a Custom Post Type in French language with fr slug. We can create single-fr.php and archive-fr.php, ...