Questions tagged [custom-post-types]

Custom Post Types extend WordPress to support additional content.

Filter by
Sorted by
Tagged with
1
vote
0answers
6 views

Custom URL and templates for displaying posts in intersection of two different custom taxonomy types

How can I create custom URLs and templates which I can then adjust to display posts from intersection of different taxonomy types. Following is the scenarios: 1) I have a two custom post types 1a) ...
0
votes
1answer
10 views

Custom Post Type page sorts differently on different environments

TLDR: My custom post type items are sorting differently on a local environment and a live server. Can't figure out why! I have a local install (MAMP) and an online dev install (GoDaddy shared, for the ...
0
votes
0answers
22 views

How to POST to the rest api from frontend without revealing password [closed]

I'm not a PHP WordPress dev but I want to be able to post data via javascript from the front end. All the plugins I'm seeing involve revealing a username and password in the javascript code which ...
0
votes
1answer
7 views

Select2 AJAX and WP Query Returns ALL and does not filter

So I'm a bit stumped here. I regularly use Select2/AJAX/WP_Query to search for and retrieve default WP post-types and my own custom post-types. Almost every site I've built over the past few years ...
0
votes
1answer
30 views

Custom fields array to display it monthly

I have an array structure from custom fields inside custom post type like the following: Array ( [webw_employee_projects] => Array ( [January] => 0 [February]...
0
votes
0answers
10 views

Featured image not appearing

I have a custom post type, the featured image works in our blog post type however in our ebooks page, it shows the placeholder instead of the featured image whats weird is the code shows it calls the ...
1
vote
1answer
53 views

wp_update_term_count_now doesn't work with a custom post type?

I have a custom post type name session and a tag name post_tag. This is the declaration of my custom post type : function create_posttype() { register_post_type( 'session', array( '...
0
votes
0answers
17 views

Add tag to a custom post type doesn't change the total of custom post type in backend

I add a tag to a custom post type nammed "session" programmatically like this : wp_add_post_tags( $session->ID, "annule"); I tried this as well wp_set_post_tags( $session->...
0
votes
0answers
9 views

Save log for imports in WordPress database - options-table, custom post type or other place?

I have a couple of custom imports, where I would like to save some log-information in the database, after they've completed, such as: How many lines was imported. DateTime for when it ran. URL that ...
0
votes
0answers
9 views

Remove custom taxonomy name from the slug - Custom Post Type UI

I'am using custom post type plugin for wordpress. I made custom taxonomy called "category" and made category for my custom post type called "Organic" as well. When I publish custom ...
0
votes
1answer
10 views

Need Help With Worpdress Parent Child Attribute

For example i have Main articles written in default wordpress posts, Now i have custom post type called ENERGY where i want to add main posts as parent to this ENERGY CPT. Wordpress posts = Parent ...
0
votes
1answer
17 views

Postname on unique permalink structure appends "-2" for a custom post type. How can I get this to stop happening?

I have a custom post type "events" that has rewrites / permalink modification in place so that it includes the year and month in the URL (these come from ACF fields). This works perfectly ...
0
votes
0answers
40 views

Custom front-end form for adding post - Category problem

I've created a CPT front-end form for post-adding. It has a title, description, categories, image, and a couple of custom fields connected with ACF in the backend. Everything is working, except ...
0
votes
1answer
18 views

Custom Post Type posts, conflict with posts after add_rewrite_rule to top

I had cpt with taxonomy like this: add_action('init', 'zsz_add_posttype'); function zsz_add_posttype() { // -- Taxonomy CATEGORIES - [category-a] [category-b] [category-c] [...] ...
0
votes
1answer
20 views

How to customize custom post type's list table?

I have created a custom post type and here's I'd like to remove the title and add several custom post meta instead, but how do i customize my custom post type's existing list table?
0
votes
1answer
20 views

Add a class to a div if custom post type has specific terms?

For example: if the post has the terms 'movies' or 'tv' I would like to add a class of "on" to a div in the post. <div class="box [added class here]" </div>
0
votes
0answers
18 views

CPT Taxonomy Sub Landing Pages

I am working on a travel site, and there is a CPT called Listings with a taxonomy called Destinations. The Destinations taxonomy is hierarchical and looks like this: Country->State->City We have ...
0
votes
1answer
57 views

How to show the post which checkbox is not selected

I have custom post type and created one custom field checkbox called is_featured. I have to show the post which is the checkbox is selected so I have used the below code and it's working function ...
0
votes
0answers
31 views

Pagination for custom post type giving 404 error (but only for news page)

Before you say this is a duplicate of another question please hear me out. I have a custom post type on a site I'm building. When adding pagination to the page (domain.com/news) it gives me a 404 ...
0
votes
0answers
16 views

While creating a post, can I restrict the authors in the dropdown list based on their user role?

I am running an online course website. The user roles include student, teacher etc. I've got 5 teachers so far, but the students are 200+. When I am creating a course(with a custom post type "...
0
votes
2answers
32 views

i want to send email to user when the custom taxonomy is changed

Hello every one i am new to wordpress development. i am working on a plugin in which i have created a custom post type with the name of application when the user submits a form from the frontend a ...
0
votes
2answers
22 views

hide specific div on single.php [closed]

I've been working on WP since a week so far i've seen bunch of tutorials and videos about wp but i feel stuck and since i'm a wp noob i cant find or think any solution for a simple problem. i have ...
0
votes
0answers
15 views

Copy data from 2 different ACF custom post types with relation

I have 2 custom post type. I used ACF to make a relationship field with bidirecional linking. Is it possible after linking the posts to copy from the linked post data from one custom post field to ...
0
votes
0answers
35 views

How to get the custom field value using SQL query

I am using the WordPress and I have created a custom post type. Also, I have added the custom field for each custom post. Now I have to fetch the data from the database and I tried the below query ...
0
votes
0answers
55 views

How to get the custom post data using post id in WordPress?

I am using WordPress, I have to get the custom post type data using post id and I tried the below code but I am getting the error WordPress database error: [You have an error in your SQL syntax; ...
0
votes
1answer
41 views

Archive page for Wordpress Custom Post Type doesn't show pagination from paginate_links()

I have a custom post type with courses-events as the slug. In functions.php, I have: add_action( 'pre_get_posts', 'custom_archive_items' ); function custom_archive_items( $query ) { if ($query->...
-1
votes
1answer
12 views

Post Per Page showing 2 posts

i need to add just a one post in index.php. But if i add post_per_page => 1 they get two posts https://i.stack.imgur.com/2POSx.png https://i.stack.imgur.com/ruAiW.png
0
votes
1answer
25 views

Should I use a custom taxonomy or custom post type for grouping a list of panels associated with a group of tests?

I am struggling to word this correctly, but we have a list of laboratory blood tests listed: Comprehensive Blood Panel Basic Blood Panel Liver Blood Panel Cholesterol Panel and many many more These ...
0
votes
2answers
32 views

Is there a way to create two template for single custom post type page?

This is a strange task but I really faced with it. On the home page there is loop for showing all custom post type. And I need to have oportunity when user click to the cpt link from the home page ...
0
votes
2answers
22 views

How to create review point system for CPTs (many-to-many relationship)

I am working on a Wordpress project where I have movies, books and games as custom post types. Any logged in user can add stars(review points) to each of the CPTs. My way of implementing this was ...
0
votes
0answers
23 views

ForEach Loop iterates only once when inserting product variations

I have been trying to create products from json results fetched via api.I am trying to create variations on the basis of colours i.e. if no.of colours is x, create x variations. But it creates only ...
0
votes
0answers
17 views

Create post meta box that links another post

I have Posts that act as movie reviews. I also have custom post types 'movies' that have detailed information on said movie. What I would like to do is add a custom meta box to the Posts (movie ...
0
votes
0answers
23 views

Set the main page for custom post type

I have a custom page type called "car", the links are site.com/car, site.com/car/audi, site.com/car/bmw etc When I access site.com/car, WordPress picks up archive.php and shows the content. ...
0
votes
0answers
12 views

Show only Current category and sub category of custom post wordpress

I have multiple post page using custom post type and all post type have more categories and sub categories So i need to display particular categories specific and categories specific to post type ...
0
votes
0answers
19 views

How to embed script in custom post type with dynamic value

need advice...I have a demo script for example: <script type="text/javascript" src="https://ssl.hhhdgg.com/embed_loader.js"></script> <script type="text/...
0
votes
0answers
16 views

Do post types share the same records using the same taxonomy?

I have created a custom post type, so I attached a category & post_tag (default wp taxonomies) as its taxonomies. so if I insert any record to posts category (or post_tag) it appears to my CPT ...
0
votes
1answer
30 views

Custom Taxonomy Search result page

I have a post type named Icons, I have a custom taxonomy named Icons Pack which have a custom field for featured image. Also I have a search form in my site for users to search for the icons they want ...
0
votes
0answers
12 views

Custom Post Type with Custom Taxonomy as Category post_type_link, after this code only the home page and the taxonomy page are opened

// Register Custom Taxonomy function portfolio_taxonomy() { $labels = array( 'name' => _x( 'Labels', 'Taxonomy General Name', 'imagewize_portfolio_plugin' ), ...
0
votes
0answers
32 views

Fetch data of 2 relational Custom Post in WordPress

I am using Pods plugin in WordPress. I am new user of this plugin. I have 3 Custom post type. Tasks, Teams and Volunteers. I can fetch Volunteers using this code get_post_meta($_POST[q], 'volunteers', ...
0
votes
0answers
18 views

Is it possible to get the specific content on the search page?

I am working on the WordPress search. I am using the below code to get the data on the search page. $s=get_search_query(); $args = array( 's' =>$s ); $query = ...
0
votes
1answer
38 views

Custom Permalink For Custom Post Type - Working Fine But Broken For Pagination

I'm having an issue with pagination not working while trying to get custom post type permalink. I've Custom post type 'songs' and custom taxonomy 'singer' here: example.com/songs/ // ...
1
vote
0answers
10 views

Child post with numeric only slug keeps redirecting to parent

I modified the allow-numeric-stubs plugin code to work with CPTs. You can view my forked repository here: https://github.com/akshatkedia/allow-numeric-stubs WordPress is now allowing numeric slugs for ...
0
votes
0answers
18 views

How To Display Posts Of Custom Post Type At Page Template

Suppose Your post type slug is cars : Code For Display Posts At Page Template: <?php /* Template Name: cars */ get_header(); $args = array( 'post_type' => 'cars', '...
0
votes
1answer
14 views

How to insert data into meta box from another plugin?

I have two different plugins. My custom-post-type is on the first plugin and it has some meta boxes. Now in the second plugin, I extracted the email using IMAP and stored it in the post type of the ...
0
votes
0answers
9 views

Set up a WP Cron scheduled event to update calculated ACF field

I have 3 ACF fields set up on a custom post type: Number Value A - automatically updated every minute Number Value B - automatically updated every minute (at the same time as Value A) Number Value C - ...
0
votes
0answers
18 views

Order posts by taxonomy terms

I have a cpt archive and want to order it by custom taxonomy terms ids. I'd like to change query with pre_get_posts if it's possible. The desired way is: Taxonomy term id 1 post id 1 post id 4 ...
0
votes
1answer
24 views

set object terms after some some time of published post - functions.php

I have to change the published post in one category to another category after some days. I have created the below code for the function, which I have added in the functions.php file in child-theme. ...
0
votes
0answers
14 views

Custom taxonomy: on the taxonomy term page show other taxonomy terms

ok, i have a custom post type LAW and two taxonomy LAW TYPE and EDITION I create a page taxonomy-law_type.php for display child terms LAW TYPE <ul class="wpb_page_list"> <?php $...
0
votes
0answers
25 views

Update query based on CPT / Post Type, show all sorted by date

I'm trying to accomplish something similar and read through Vayu's code, which is super elegant, but it doesn't accomplish what I need. Specifically, I need to be able to include a different template ...
0
votes
0answers
11 views

Setting Author on CPT

I have a CPT and have allowed the "author" to be displayed. However, in the Author dropdown, it only shows Admins - not my other users with the role of "Business Owner". I've tried ...

1
2 3 4 5
200