Questions tagged [custom-post-types]

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

Filter by
Sorted by
Tagged with
0
votes
1answer
31 views

Use the custom post type archive for taxonomies?

Im using a archive-cpt.php template page to display all my custom post type posts but now I will be categorizing them in taxonomies. I want to add a dropdown filter navigation that will be populated ...
0
votes
0answers
40 views

Display post date with the date archive link for custom post types

i have a custom post type and every single post it displays post date like 05 Jun 2019. i show this date with this code : <a href="<?php echo get_day_link(get_post_time('Y'), get_post_time('m'),...
0
votes
1answer
18 views

Is there a function that replace category name with a icon?

I am using a Custom Post Type and I have a Taxonomy name "Type" this taxonomy have A y B taxonomy names. If possible a function that remplace the name of Taxonomy with an icon or image? Thank you!
0
votes
1answer
14 views

Change custom post taxonomy values from front-end

I'm developing a ticketing system which already has the custom post type for the tickets with a "status" taxonomy. I have the tickets displayed in a table on the front-end and the status column has ...
1
vote
1answer
45 views

How to limit post of custom post status?

I have a custom post type 'Commercials' and custom post status 'Featured'. Now I want only one featured post. What I mean is right now I can make all posts as Featured, but I want only one to be ...
0
votes
0answers
17 views

Display all posts from specific category and CPT

Currently, we are getting all posts from a specific category using the following: $args = array( 'post_type' => array('post'), 'cat' => 1247, 'posts_per_page' => 4 ); What we'd ...
1
vote
1answer
21 views

Custom WP Query on custom meta and sort by multiple meta keys value

I am testing something out and I have a query like this: $paged = 1; $filter_min_price = 5; $filter_max_price = 300; $products5_cat_term_id = 368; $filter_brand = "Now, Garmin"; $sort_order = "ASC"; ...
1
vote
1answer
22 views

Can I override a CPT template on a per post basis with Gutenberg block editor?

I have a CPT defined in code called event, and there is a template file for the markup (single-event.php). I am wondering if it is possible to override a post within the Event CPT with the Gutenberg ...
0
votes
0answers
14 views

show count and sort by curtain post type in taxonomy list

i have a taxonomy list with post count and it sorted by post count. but i want taxonomy list to show only curtain post type count and sort by ount of this post type this is my code function ...
0
votes
0answers
16 views

Set custom post type posts as children of all pages

I'm sure this is possible, but I can't seem to get my head around the best way of setting this up. We are building a website that gives each of our clients a video library page. The videos are stored ...
0
votes
0answers
16 views

Placing custom post types as submenu in admin menu and moving additional admin elements around

So, in my custom Wordpress plugin I have two custom post types. My customer wants to have them grouped under one main admin navigation item. I go and create the main admin item using: add_menu_page(...
0
votes
0answers
20 views

Problem with multi checkboxes value in metabox?

I'm a beginner and I have a problem with a part of the script that I found in a post. Practically when printing the checkboxes it does it outside the table. I can't bring the content of the foreach ...
0
votes
0answers
26 views

Conditional actions by user role

I am making a paid subscription site using Paid Memberships Pro and I need to make some custom actions by user role. All I have found is conditionals for current user, so I figured I can check ...
0
votes
0answers
14 views

WordPress Admin listing issue on custom post type on Safari

I am having a strange issue on showing the information on custom post type listing. When we list custom post type on iphone safari, there is a "Show more details" button to display more information ...
0
votes
0answers
21 views

wp_get_attachment_image_srcset returns false for CPT

I have created a CPT function create_themes_posttype_raihan() { register_post_type( 'themes', // CPT Options array( 'labels' => array( 'name' => __(...
0
votes
1answer
24 views

Custom Post Type 404 Error even after flushing rewrite rules

I've declared a custom post type as below, I can create posts in admin but when I try to view I'm getting 404 error. I've declared a previous custom post type using similar code and it worked fine. I ...
0
votes
1answer
21 views

How can I register multiple custom post fields to json?

sorry if this question has been asked before. I have a few custom fields created with ACF and I am trying to push these fields to json, to use them in a js file. My code looks like this: function ...
0
votes
1answer
24 views

Disable Sidebar on certain pages

Good day! How do you disable/remove sidebars in certain pages? Do I need to install a plugin(what plugin)? Or should I do a custom code? Thanks.
0
votes
0answers
14 views

show posts using wp_list_categories

I want to list all parent, child, grandchild etc. taxonomies and the posts for those. Currently it lists all the taxonomies nicely indented in correct hierarchy but it shows no posts. Can you show ...
0
votes
1answer
23 views

CPTUI rewrite disable when no post in CPTUI has been found

I have a CPTUI with the following data: function cptui_register_my_cpts_activaties() { /** * Post Type: Activaties. */ $labels = array( "name" => __( "Activaties", "red-...
1
vote
1answer
22 views

Custom Taxonomy not showing as option on custom post page

set up a custom post type for service and a custom taxonomy for service type. The services post type is showing up but there is no option on the page to add the services-type taxonomy. Here is my ...
0
votes
2answers
45 views

How to search from specific post type with tags?

UPDATED: I have a Custom Post Type Commercials. This post type has a title and a video id. I want to search from this specific post type. Right now it returns result which matches the titles only, I ...
0
votes
1answer
36 views

Save_post acf data not updating category of post type

i am trying to assign multiple categories to my Custom Post Type using advanced custom field named 'cat'. But there is nothing saving to my categories. Any help? <?php // Add an action to run on ...
0
votes
0answers
33 views

Enabling hierarchical in a Custom Post Type gives error 404

For a project I have a custom post type called Place. This custom post type can have a page as a parent, and that page can have other parent and so on. Place is always at the end of the sequence. At ...
0
votes
1answer
15 views

Looping to organize and display custom posts by category using PHP and WordPress

I am developing a page that requires me to display a list of categories for a custom post type in an accordion-style dropdown. The category name will act as the accordion title, and the contents are ...
0
votes
0answers
17 views

Export Custom post + WPML

Hi everybody I have a Main wordpress with 500 custom post type, some of them are in Spanish, some of them in other language through WPML. I need to export them into a new wordpress, but I only ...
0
votes
1answer
34 views

Open Custom Post Type as PDF

I have a custom post type set up using CMB2. I have overriden the standard print template, so when a user wants to print the page it takes the CMB2 fields and organizes them into a specific layout ...
0
votes
0answers
50 views

Structure and hierarchy of new “Sights” custom post

I am about to writing a request to dev team of WPTRAVELENGINE. A WordPress plugin adds a custom post called: "Trips" With taxonomies like: Destinations (main taxonomy for items like cities and ...
1
vote
1answer
33 views

Is possible add class for last post of Custom Post Type?

I need to add a different class for last post of a Custom Post Type. Is it possible? I have found this code, but it works only in posts function wpc_last_post_class( $classes ) { global $...
0
votes
2answers
27 views

How to have a dynamic slug and rendering the archive-{post_type}.php?

So I have a Custom Post Type named network and Custom Taxonomy name company_category. Everything is all good until I can't render http://localhost/digitalhxstaging/company. Both Company Category and ...
0
votes
1answer
88 views

Rewrite CPT slug with two taxonomy slug instead of one

I have a post type location with 2 taxonomies in it - service & sector. Now, normally wordpress would show the permalink like - site_url/location/post_name I've made it work to show - site_url/...
0
votes
1answer
49 views

How to define the template for custom posts?

I created a new custom type called 'books' and I created a Field using the Advanced Custom Fields plugin where I define the fields and create the records, with post names such as book1, book2, etc. I ...
0
votes
0answers
13 views

Single post showing 404 not found page (permalink problem)

Using WordPress' default post type, I'd like everything to be filed under /blog/. For example: /blog/[parent category]/[child category]/[post permalink]/ Here's an example post: Parent category: ...
0
votes
1answer
29 views

Videos Post Type with Custom Filters

Basically, I am trying to achieve exactly same as in this link: https://www.fitnessblender.com/videos In my WordPress site, the first thing I did was creating a post type 'videos'. I am not sure ...
0
votes
0answers
42 views

How can I set cookies on my posts so that I can get view count of that post [duplicate]

Can anyone help with the solution? This is my post and I have created a custom column to get view counts on my single post. I'm want to keep a track of views for every single post. I'm trying to set a ...
0
votes
1answer
37 views

Custom post type single with custom URL structure

I have a function that rewrites the URL before post slug including a custom taxonomy function wpa_show_permalinks( $post_link, $post ){ if ( is_object( $post ) && $post->post_type == '...
0
votes
0answers
13 views

Batch convert Woo Products & Tags to a regular blog post

Is it possible to batch convert woo commerce products to regular blog posts while keepng the featured image, tags, catagories etc. I’ve got a couple of woo sites that need transforming to regular ...
0
votes
1answer
131 views

Repeater field empty taxonomy and saved choices

I'm in trouble right now and I need you to help on a little problem that I have. For one of my clients I need to use ACF repeater field and populate it with empty categories from a custom taxonomy ...
0
votes
1answer
24 views

Adding Multiple Post Types to Query [duplicate]

I'm trying to add a 'Lessons' post type to populate the wp-query as well as the pre-existing post type 'Modules. Preferably I would like them to be combined into one query showing the most recent 6 ...
0
votes
0answers
49 views

Update button not working on some posts

For some reason, some of my posts will no longer update. The button is there, but clicking it does nothing. It’s only certain posts. It is a custom post type with custom fields, but posts under the ...
0
votes
1answer
42 views

WordPress hook which triggers on post import

I am adding few meta fields for product post type using wp_insert_postaction and it is working perfectly. But I have to trigger my function upon product imports as well as this action is not firing ...
0
votes
0answers
24 views

Rewrite CPT url parameter

I am rather novice to rewriting so I would appreciate some help. I've set up a custom post type (teacher) in WP. Later, it was decided that its slug must be changed to (instructor). The problem is ...
0
votes
0answers
18 views

Permalink URL connection between two custom types

We use latest WP 5.2, and the super plugins Advanced Custom Fields Pro (ACF Pro) and CPT UI. In our website taxonomy, we need to have events, within which we have talks and workshops. Example ...
0
votes
0answers
39 views

How can I JOIN two wp_posts?

I have a problem with table JOIN SQL (CPT/Pods). For many hours I tried, but no result. Ex. studio (post_title, city, date, song->) song (post_title, date, band->) - SELECT wp_posts.ID AS ...
-1
votes
1answer
15 views

Output assigned custom taxonomy to custom post type

I created a custom post type called "capitulo" and custom taxonomy called "serie" and i wanna output asigned taxonomy to custom post with link. Here is my code <?php //...
0
votes
1answer
29 views

How to display hierarchical and non-hierarchical taxonomies?

I have created custom post type and 4 taxonomies. First, second and third taxonomy is hierachical, the last is not. Is there any possibility to display separetly hierarchical and non-hierarchical ...
0
votes
0answers
28 views

Wordpress custom post type taxonomy paging

I am trying to pagging my taxonomy-products_categories.php. But unfortunatily it throw me to 404.php page rather then page/2. Following is my code for custom post type and its taxonomy. $labels = ...
0
votes
0answers
16 views

Is there a way to setup permalinks structure for Taxonomy term and custom post single without conflict?

This is the desired output: a.) for taxonomy term = /post-type-slug/taxonomy-term-slug/ b.) for post single = /post-type-slug/taxonomy-term-slug/post-name/ The problem is only one of these setup ...
0
votes
0answers
15 views

Custom Taxonomies and Relationships

I have created a CPT named promo-codes. I have registered 2 custom taxonomies to this CPT : brand and categorie. I am using the archive page of the brand taxonomy to list all promo codes by brand ...
0
votes
1answer
39 views

Populating Custom Fields from live JSON

I'm trying to populate WP custom fields using the code below, my problem is I can't output the nested JSON field data.quote.USD. Can someone help find the right direction here? Thank you. //some code ...