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
1
vote
0answers
11 views

Not Able to Get Custom Post Type Gallery Images URL

I have a CPT called books and I am able to loop through it like <?php $loop = new WP_Query(array( 'post_type' => 'books', 'tax_query' => array( array( 'taxonomy' =...
1
vote
1answer
11 views

Filter CPT posts by one or more categories

I'm trying to filter the posts on a CPT by one or more categories. Here's what I have so far: $args = array( 'post_type' => 'cpt-name', 'posts_per_page' => -1, ); // ...
1
vote
0answers
8 views

Custom taxonomy and custom post type - wrong permalinks and template

so here is the deal - I've got a CPT called opencourses. It has some permalink structure, lets say: open-courses. Recently I've decided to add here a custom taxonomy as well. Im doing it via this code:...
0
votes
0answers
8 views

WP_Query search posts by custom post type and custom taxonomy

I have custom posts articles with custom taxonomy tags-articles, I need search all posts with have the term in title, or taxonomy associated with same title (or partial title): Example os published ...
1
vote
1answer
11 views

How to create custom post by using REST API securely?

I am new to this. Figuring out how to use it. I am trying to create a custom post by filling out a frontend form. I am using ajax button in the form. This button triggers wp_remote_post().I have the ...
0
votes
1answer
13 views

Changing permalink of default Post with custom post

I have created new post type for jobs and i was using the default post for my blogs. Now the issue arisen for the jobs permalink as i was using example.com/blogs/%postname% earlier now i want on jobs ...
0
votes
0answers
11 views

how to link subdomain backend to main backend?

when you have to create m.domain.com subdomain for mobile devices,do you usally re crate backend (such as C.P.T posts combined with A.C.F ) or there is way to link subdomain backend to your main ...
0
votes
0answers
10 views

add a static html form with api in wordpress backend this api get data through xml file another server

I have a html form with api this api work on another october cms server website. i have only url october cms website now i want to add this form with api url add in new develop wordpress website i.e ...
1
vote
0answers
18 views

Can I update all my posts inside my custom post type by creating a simple function

I'm stuck at a scenario where my events custom post type posts have categories ticked but not actually assigned to them untill I manually republish or update every single post. And its happening ...
1
vote
0answers
23 views

How to create our own routes in wordpress for a custom post type?

I have a custom post type called 'event'. Now an event has multiple subpages like registration, speakers, contact us, etc., I have each one of the content is saved as one or more custom fields. I ...
1
vote
0answers
12 views

Custom post type archive page - Posts overview - with one modal for multiple posts?

I will try to explain what I am trying to accomplish. I have created a post type "cars" and a file archive-cars.php When I visit this page slug it displays all the posts. I have created a Javascript ...
1
vote
0answers
11 views

Setting up taxonomy to relate various custom post types - advice on structuring?

I have been using post meta to relate various custom posts types and recently realized, based on various discussions here with wiser developers, that taxonomies are probably the way to go. My site is ...
1
vote
0answers
23 views

Should unaltered default loop/query return a list of custom posts belonging to a custom taxonomy?

Short version: I am wondering if the default WP loop (for example in a rather simple index.php) is supposed to return custom posts belonging to a custom taxonomy when the URL is something like https://...
1
vote
1answer
13 views

Getting categories of posts under a custom taxonomy

I have a CPT with the following taxonomies: category, taxonomy_1 and taxonomy_2 (the last two are non-hierarchical). I want to get programmatically all the terms of the "category" taxonomy but only ...
1
vote
0answers
17 views

Index page with the same id as the slug

I have wanted to ask this for a long time.. I have never worked out how to do this, is it possible? mywebsite.com/pots - This to be an index page showing posts or custom posts mywebsite....
1
vote
1answer
19 views

Adding dropdown select meta box to custom post type - seems restAPI is interfering

I have a custom post type, call it topic. It is from BBPress, but this isn't a BBPress question. I also have a post type lessontopic. I added a meta box to BBPress so that I can choose an associated ...
1
vote
1answer
22 views

Admin not showing all custom post type posts and views not working

I have a custom post type called pasakumi and for some reason in wp-admin the views (All / Published / Trash) are showing only 4 random posts, even though I have more than that. They're also not ...
1
vote
0answers
19 views

Should wp_postmeta meta_key always be unique for a given post_id?

I am trying to figure out a good way to establish relations between various post types. For instance, consider a post type lessontopic and another post type forumtopic. A Lesson Topic can have ...
1
vote
0answers
15 views

Why does using WP_Query inside a shortcode in an elementor page cause the arguments for WP_Query to get malformed?

I am trying to embed a custom WP_Query inside a shortcode I have activated on one of my pages (created in Elementor). I have a Custom Post Type called 'inspector-profiles', and for some reason when I ...
1
vote
0answers
16 views

Incorrect post_type in url of taxonomy term

I have registered a custom post type oa_location with custom menu (using show_in_menu) and a taxonomy called oa_country. These two connected but because our CPT placed in a custom menu, there is a ...
1
vote
0answers
67 views

Limit users by custom taxonomy and user roles

This is not duplicated post! I working on the custom theme and have 2 taxonomies: bezirk and ortsgruppen. bezirk acts like main group and ortsgruppen is the sub group under bezirk. I need to asign ...
1
vote
0answers
17 views

creat filter with wp_query

I doing make a filter with wp_query for a custom post type. I create my page and I want to include a filter by date (year) with wp_query <?php get_header(); ?> <div class="row"> <...
0
votes
0answers
18 views

How to display a table based on data from a custom content type with custom fields

I have created a new content type called "casinos" with the following custom fields: Bonus Offer Rating Score Aff Link Casino logo I created 10 posts of "casino" type which contains information ...
0
votes
0answers
28 views

get_queried_object not work in taxonomy page

I am trying to display post count by month of current custom taxonomy in custom taxonomy page. but it display total count by month <?php $post_type = "tesekkur"; $posts = get_queried_object()->...
1
vote
0answers
11 views

Troubles with acf/save_post and WP_Query

I made an accounting system with ACF and CPT, but my client wants to be able to see the balances of each account from the post table in a column and not entering the single of each account. My ...
0
votes
1answer
21 views

Group custom post type posts by month

I need help grouping posts by month+year (sorted by the date the posts were published a), when in result I'd have something like this: November 2019 Event 1 Event 2 December 2019 Event 3 Event 4 ...
0
votes
1answer
18 views

I'm trying to create an if statement that will only display my button link for tickets if its under 'admission-event'… what is wrong with my code?

<!-- column links --> <div class="col-md-3 offset-md-2 links"> <?php if ( is_category( 'admission-event' ) ) { ?> <a href="https://www.eventbrite.com/d/ut--salt-...
0
votes
1answer
5 views

CPT and rewrite rules

I have CPT "Library" with "Library-category" taxonomy. What I want to achieve is to have: https://example.com/library - archive page for Library CPT https://example.com/library/case-study/ - archive ...
0
votes
0answers
12 views

How to have post_type_link filter alterations be reflected on admin post edit view?

say this: // from register_post_type ,'rewrite' => array( 'slug' => 'prodotti/%product_categories%', 'with_front' => false, 'pages' => false ) then add_filter('post_type_link', '...
0
votes
1answer
16 views

Post Click Redirect to Custom URL instead of Single Post Page

I have a custom post type called "articles". When an article link is clicked, I want to redirect them to custom URL(this URL is saved in the database as custom field) instead of the single page. How ...
1
vote
0answers
17 views

Adding custom post type taxonomies to revisions

I'm using a simple plugin by John Blackbourn, the code is shown here: <?php /* Plugin Name: Post Meta Revisions Description: Revisions for the 'foo' post meta field Version: 1.0 Author: ...
1
vote
0answers
10 views

A method for ordering mixed dates in search result loop (theory only, no actual code)

My issue Hello, some time ago: I had the regular post and the custom evento post types; the evento post type had a ev_data_out custom field; the search result loop had to return a list of posts from ...
0
votes
0answers
12 views

Rewrite rules for custom taxonomies

I got car custom post type. And got custom taxonomies (model, year, color) for car post_type. Car archive link looks like this: https://example.com/car/ And i am filtering this archive page with $...
1
vote
2answers
34 views

Wrong generated page_name/slug on first publish of custom post type

I have set up a custom post type (CPT) with the support for editor removed: register_post_type( 'review', array( 'label' => 'Reviews', 'labels' => array( 'name' => 'Reviews', ...
0
votes
1answer
18 views

Attend event form with ajax

I've created a Wordpress website with gigs from a band. All the logged in users can select if they've attended that specific gig. Something like setlist.fm. So I've created a new table ...
0
votes
1answer
16 views

Custom Post Type “MUST NOT” be able to search via URL

Hello good day everyone, Guys any idea how to hide permalinks from custom post types and should not be able to access via url. By the way, Im using Pods framework for my CPT's Example: www.example....
0
votes
0answers
23 views

Querying posts that don't have a certain key value or don't have the key

The intention is to search for customers who do not have coupon X or do not have any coupon. $query = array ( 'post_type' => 'clients', 'meta_query'=> array( ...
0
votes
0answers
22 views

CPTs relationship

I have two CPT - project and publication. Is there a way to "connect" those CPSs to the permalink looks like: foo.com/project/lorem/publication/ -> archive-publication.php foo.com/project/lorem/...
0
votes
1answer
14 views

Bulk delete (custom type) posts that are not visible on website

We have a custom post type with over 16.000 posts in database. Each post has a custom meta data 'expiry date'. We want to regularly delete old posts that have: 1. Expiry date older dan 2 years AND 2....
0
votes
1answer
27 views

I am trying to get cutom post cout by month of current taxonmy term

Hi please help me how can i display custom post count by month like this at current taxonomy page. **i have been trying to solve this problem aready 2 weeks. ** December 0 January 0 February 0 ...
1
vote
2answers
25 views

Custom Post Type Display and works but But Blank Quick Edit

I have a mystery problem. I have successfully created a custom post type, with associated categories. BUT, when I list the posts, the QuickEdit section does not display the title, date or any ...
0
votes
0answers
22 views

Display specific custom post types

i added a code to display custom post types on my web site like other posts. function add_custom_types_to_tax( $query ) { if( is_category() || is_tag() || is_home() || is_author() || is_page() |...
0
votes
0answers
23 views

Two Custom Post Types in Permalink + Duplicate Slugs Issue

I'm having some trouble with WP adding those numbers onto the end of my slugs if it thinks it's a duplicate slug. The issue, though, is that it's not actually a fully duplicate URL, since I include a ...
1
vote
0answers
15 views

Month list with post count for current taxonomy term [closed]

please help me to create Month list with post count for current taxonomy term. Can anyone help me please. i want to show custom post type count by month of taxonomy in archive page for current year. ...
0
votes
0answers
35 views

How to sort by multiple values in a nested WP_Query

I am displaying courses, enrollment, along with rooms whose capacities are greater than or equal to the enrollment. This query works, except the 'order' => 'DESC' for courses, and 'orderby' => '...
0
votes
0answers
20 views

wp_insert_post deleting previous post custom meta

I have created a custom post type called "pay stub" and two custom meta fields "net pay" and "link" (the link to the pay stub file) and two custom taxonomies, "status" and "employee". I set the ...
0
votes
0answers
15 views

Content page for each taxonomy of custom post type as child page

I have a custom post type which I wish to follow the URL structure of: /[post type]/[post name]/[taxonomy name]/ I wish for both this page and the regular CPT URL (/[post type]/[post name]/) to have ...
0
votes
1answer
20 views

Get custom post type REST API not working

I want to load the content of a modal using the REST API of wordpress. I've added the show_in_rest param to the custom post type I've registered in my function file, but I'm unable to load it, I will ...
0
votes
0answers
48 views

Show custom post status when logged out

Background: I have a few different custom post status on my installation. We use them for a workflow. Lets just say for example we have: Draft (built in) ForClient (custom) Published (built in) Now ...
1
vote
1answer
25 views

Are pages consuming more server resources than posts?

Is there any performance difference between the way wordpress handle pages and posts when i'm querying for them ? In the same way, is there any performance difference between hierarchical custom post ...