Questions tagged [custom-post-types]
Custom Post Types extend WordPress to support additional content.
10,120
questions
0
votes
1
answer
40
views
How to store the third party script with HTML code in the wordpress custom input field?
I have created a custom field on my custom post. Below is the code I am using for the custom field.
<?php
function wpt_add_thirdpartyvideo_metaboxes() {
add_meta_box(
'...
0
votes
0
answers
12
views
Custom Post Type meta data getting deleted on bulk editing taxonomies
I am facing a weird issue while editing custom post types. I created a Custom Post Type and a taxonomy linked to it. Posts are attached to their respective taxonomy terms. I also added some meta data ...
0
votes
2
answers
25
views
Getting Same Description in All the Custom Taxonomy Posts
I have developed a custom taxonomy post type. I have displayed categories & inside categories posts/(products).
I am getting the Post title & Image as they should be (which I add), but the ...
0
votes
1
answer
55
views
How to display list of custom post taxonomy terms and their posts (if any)?
So I've created a custom post type (location) and a custom taxonomy (city) to go with it. I'm trying to set up a page where it lists the taxonomy terms followed by any posts associated with that term. ...
0
votes
2
answers
26
views
Wordpress Set A Static Page/Template For All Sub-Pages
I have a wordpress install where I want to serve a static page/template for anyone arriving at a child of a certain page, e.g.
https://example.com/products/*
Would all serve a php template from ...
0
votes
0
answers
16
views
How to achieve a multi-taxomony layout with posts?
I'm trying to achieve a layout involving a Custom Post Type and Multiple "categories". For example, I have a post type called "Diagrams" and the categories will be "Guitar&...
1
vote
0
answers
31
views
Set URL link to featured image of custom post type
I am storing data from an API in a custom post type made up with Advanced Custom Field. The API returns image urls, where each is given a text field in Advanced Custom Field. I'd like to set a ...
0
votes
1
answer
51
views
post_type_link Filter - Too Few Arguments
I am building a website for a client with an existing website and I need to set the URLs to be exactly like they are in his old website.
I have created a custom post type with a custom taxonomy for ...
0
votes
1
answer
66
views
Custom ordering of CPT items not matching with the ordering of its pagination
I have a CPT and I am changing its ordering by a numeric value of a custom field. My custom field name is "ordering". The ordering of my CPT is changed like this:
$posts = get_posts(array(
...
0
votes
0
answers
17
views
How can I create new CustomPostType record using wp.api.collections?
I would be very grateful for your help. Already racked my brain for today!
So, I used the CPT UI plugin and created my custom post type with it. Immediately when setting it up, I enabled RestAPI ...
0
votes
1
answer
102
views
Custom endpoint filtering post by custom taxonomies
I am trying to create a custom endpoint by custom taxonomies, I have already created another for the categories and it works well, however there is something I cannot solve with this
function ...
0
votes
1
answer
48
views
Api rest_route 404 while building filter for custom posts (filtered by multiple meta keys / custom fields)
I am working in a WordPress site that has many custom post types, and extensive use of Advanced Custom Fields (ACF). The site also uses node modules, custom code from scratch, and Git in favor of a ...
0
votes
0
answers
26
views
Display custom post types by category
I want to create a listing of custom post types in a particular category. I've tried the code below without any success. Can someone please show me where I have gone wrong?
The custom post type is ...
0
votes
0
answers
16
views
What is the best way to set the post category (Custom Post Type) automatically based on the one of the tags assigned to the post?
I have an automated workflow where I use a plugin in Adobe Lightroom Classic (LrC) to publish a collection of photos to my Wordpress site. This workflow automatically creates a project post (Custom ...
0
votes
0
answers
137
views
Link custom post type to parent page and show in slug / breadcrumb
I am using the Custom Post Type UI plugin to add custom post types to our website. We now created a CPT called IPDC.
For this custom post type, we would like to have the option to link every IPDC page ...
0
votes
0
answers
32
views
Pagination links for custom post type shows correct number of links, but links result in Page not found
This topic has many similar posts, but I'm not finding one that addresses my issue precisely.
Here is what I have done so far:
I added a Custom Post Type to functions.php. This works. The imported ...
1
vote
0
answers
73
views
Isotope Filtering with Bootstrap Tabs - Custom Post Type Query Loop in each Tab (Have to click twice to filter)
I am trying to use isotope filtering (cool animations) with bootstrap tabs where each tab-pane has its own custom post-type query loop. For some reason, I have to click twice on the tabs to have the ...
1
vote
0
answers
26
views
custom taxonamy and post type
I have a little problem with showing of my taxonomy template my codes to create custom post type are:
function setup_projects_cpt(){
$labels = array(
'name' => esc_html_x('Projects',...
1
vote
3
answers
207
views
disable /feed/ for custom post type
Our custom post type posts have an extra feed in their source code:
www.example/post-type/post/feed/
I want to remove the extra /feed/ from our CPTs, as they generate 404s.
From the register_post_type ...
0
votes
0
answers
22
views
Custom Form / Search with Custom Post Type Data
I'm trying to build a site that will allow people to check their status of vehicle registrations. I'll be using a CSV (without any Personal Identifiable Information) that is uploaded nightly (by ...
0
votes
1
answer
59
views
How to display posts from a certain category in a bootstrap 5 carousel loop with multiple items?
I am a newbie developer who is still learning, and at the moment I am developing my very own first wordpress custom theme. However, I am struggling to get this working. I Have a "Hero" ...
0
votes
1
answer
78
views
how to get this tax_query working?
I have wp_query including custom taxonomy terms which works if all the fields have values. Otherwise, it is giving 0 results.
This is the form that is used to get the taxonomy terms.
Based on the ...
0
votes
1
answer
21
views
Enable taxonomies by post type in an array of CPTs
I learnt to add multiple custom post types via functions.php in an array, like this:
add_action('init', 'all_custom_post_types');
function all_custom_post_types() {
$types = array(
array('...
0
votes
0
answers
22
views
Settings -> Reading -> Posts Page ->Blog -- is not working in my website
I have a problem with blog posts on my website.
The Blog doesn't show posts. I tried several times to set the 'blog page' as a 'posts page' but the setting doesn't show any effect/change.
Settings -&...
0
votes
1
answer
15
views
How can I trace inconsistency in loading a template?
I have two (almost) identical wordpress websites. A devel/local and a production/remote. I have a custom post type "event" created through Meta Mask on both instances. I want to render a ...
0
votes
0
answers
25
views
Invalid content when I try to import custom post type from the old template wordpress
I changed my wordpress theme on December 2021, and Im still trying to import the custom post types of my old theme to my new one.Ive tried like 5 times, the only thing that is importing is the ...
0
votes
0
answers
68
views
allowing custom user role to access custom post type in wordpress admin
I am trying to add a custom post type access by only custom role (Newsletter manager), tried below code to get the solution, but when I log in using credentials of user (having role of newsletter ...
0
votes
2
answers
22
views
Delete "Post Published. View Post" for custom post type
I'm working on a plugin with a custom post type called "important_dates"
I want to delete the Wordpress admin notification when a new custom post is created.
Here is my code - it deletes the ...
0
votes
1
answer
28
views
How to specify a template for a path like http://example.com/something?
I created a custom post type ('explore') that we use in the site. The pages for this section live at http://example.com/explore/page-name
These pages work just fine, but if a user were to back out of ...
0
votes
0
answers
19
views
How can I put content before my custom post type default pages?
I created a plugin with a Custom Post Type, and I want to add a menu before all of my plugin pages.
The pages are mixed, there are custom pages (where I can add the menu easily), and there are a few ...
0
votes
0
answers
25
views
How to add page the same slug like custom post type?
Hi we have the custom post type:
$labels = array(
'name' => __( 'Recipes' ),
'singular_name' => __( 'Recetas' ),
'add_new' => __( 'New Receta' ),
'add_new_item' => __( 'Add ...
0
votes
0
answers
180
views
Wordpress REST API: Query media files attached to a custom post type
I want to attach an React native app to a Wordpress E-Learning Portal (leveraging the LearnPress-Plugin) to authenticate enrolled students and download audio assets of the course to the app.
The ...
0
votes
1
answer
26
views
Custom Post Meta from custom metaboxes is randomly being deleted
For a while now I've been applying and updating some custom metaboxes that my company re-uses on different sites. (Not the same metaboxes, but the same methodology.)
Essentially it allows for the '...
0
votes
2
answers
26
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
1
answer
243
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
1
answer
36
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
0
answers
15
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
1
answer
141
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(
'...
1
vote
0
answers
24
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
0
answers
12
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
0
answers
37
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
1
answer
19
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
1
answer
30
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
0
answers
50
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
1
answer
44
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
1
answer
28
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
1
answer
23
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
1
answer
108
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
0
answers
41
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
0
answers
23
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 "...