Questions tagged [custom-post-types]

Custom Post Types extend WordPress to support additional content.

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

ajax response not recieving

Will anyone help me in this regard. My problem is that when I ajax request WordPress, when I log that response in console it shows error/complete not response. jQuery(document).ready(function($) { $("...
0
votes
0answers
16 views

Show post only for user that matches category

Disclaimer: I am not a developer. I know really a little code. Hey! Thank you for your time! Well, the situation is like this: I have posts that are set to "CategoryA" for example. In Elementor I ...
0
votes
0answers
7 views

Question: How can I retrieve the post details liked by the current_user using the post_id from the “Different” post_type?

I am soo new to Wordpress development, so I am so lost in this. I have a custom post type "Like" that automatically adds the post_id of the page/post the user liked, and the "Like" post type contains ...
0
votes
1answer
26 views

How do I code access to the built-in UI of a CPT when it's placed as submenu of another CPT that is protected by role?

I am toying around with WordPress capabilities, and having some difficulty understanding where I am going wrong. Right now, I have an admin menu that appears for all administrators with STUDENTS as a ...
0
votes
0answers
17 views

$wpdb->insert not working inside save_post tag

Will someone help me in this. add_action( 'save_post', 'product_price_box_save' ); function product_price_box_save( $post_id ) { if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) ...
0
votes
0answers
16 views

CPT next post issue

I'm struggling on this one. I've inherited a project where I need a next post item on a custom post type. However, initially the CPT didn't have an archive. The following code I put in, is inside the ...
0
votes
1answer
13 views

Reordering admin columns for CPT with custom taxonomy and an added custom field

This may be a repeat but it's the combination of things I can't find. Custom post type is event. I have added an admin column 'Event Date' generated by ACF and it appears at the right. Everything ...
1
vote
0answers
7 views

Wordpress comments_open for specific user role or post type

comments_open is used for both post types, posts and products, the snippet below worked and allowed only (example) role users to comment enter code here add_action( 'init', function(){ $u = ...
1
vote
0answers
11 views

Keep a post copy when this one is updated - issue

I try to keep a copy of the previous version a custom post when this one is updated. It works, but duplicate the previous version twice. Help appreciated ! DUPLICATE FUNCTION : function duplicate($...
1
vote
1answer
10 views

Cron job for creating posts not excecuting properly

I've written a PHP script to create custom posts programmatically from Google Calendar events, and an action hook that purges all existing events and repopulates it with current ones. This works fine ...
0
votes
1answer
28 views

Restrict Access to Posts based on Custom User and Post Meta Data

I have a custom Post Type called Club Pages, and a custom role called "Club Leader". Club Leaders currently can only read, modify, and delete all Club Pages posts. However, there are many different ...
0
votes
1answer
18 views

Getting post attchment URL to populate a CPT Admin Page Column

Just trying to work out how to get the url of a file attached to a Post and displaying that in the admin page for that CPT. The file is attached to the post via an ACF file upload field called '...
0
votes
1answer
17 views

How to show first name and last name in custom post type columns

With the below code I am showing the user who created the custom post type's entry but only their username. This isn't helpful enough as I want to show their full name ie: first name and last name but ...
0
votes
0answers
17 views

Custom Metabox Info Not Saving

I have a custom metabox on a custom post type, and the input data disappears after I save/update the post. I've read through a bunch of similar questions but can't find an answer that fixes it for me. ...
1
vote
0answers
13 views

Unable to get Custom Plugin Options data

I have created a custom courier tracking plugin and I need to save courier API in plugin option page. Here is my code // create custom plugin settings menu add_action('admin_menu', '...
1
vote
1answer
14 views

How to use terms from the same custom taxonomy in different roles in a custom post type?

How can I use terms from the same custom taxonomy in different roles in a custom post type? I am developing a genealogy site which includes among other things biographies of ancestors, presentations ...
0
votes
0answers
9 views

Woocommerce style permalink structure

I was wondering how I use a custom post type written in code and make the URLs work similar to Woocommerce products. For example, I want my custom post type to work like so: /produce/ -- archive of ...
1
vote
1answer
9 views

How do I order multiple custom post types in the same menu position ( menu_position = 20 - below Pages)?

These are the args I used to get "Artists" display above "Master Artist Lookup" using the "menu_position" parameter. However , still does not display in menu correctly $args = [ '...
0
votes
1answer
19 views

Loco Translate: Custom Post and Custom Taxonomy Labels not translated in wp-admin menu

I am currently translating all of my plugins with loco translate. This is working fine on frontend and in all metaboxes in the backend, but not in the wp-admin menu: The red circled word should be in ...
0
votes
0answers
7 views

How to make mydomain.com/[post_typeA]/[post_nameB]/[post_nameA] not 404: custom post types rewrite rules. ([PostTypeA]/[ParentPage]/[ChildPage])

I scoured this forum and a lot of others but I have not found the answer and starting to doubt whether it's even possible.. I'm trying to make a site with week and day posts, a day post is called "...
0
votes
1answer
20 views

The Difference Between Categories and Tags and Taxonomies and Terms

I've got a custom post type 'articles' and I've added a custom taxonomy 'articles_categories' which has its own terms. I was under the impression you can't have categories and tags on custom post ...
0
votes
1answer
91 views

Get custome post type name

I have a custom post type named 'industry', I tried to use get_post_type_object('industry')->labels->name to get the name but end up return empty value, what is wrong? This is the registered ...
0
votes
0answers
15 views

Display Custom Post Type Based on Taxonomy With WP_Query()

I would like to pull in 3 posts from a custom post type called 'articles' that have a 'Featured' custom taxonomy term. I'm using the code below, but it isn't pulling in just the posts with the '...
0
votes
0answers
14 views

Issue with WordPress AJAX Filtering breaking links on frontend

I've been using AJAX taxonomy/post filtering for the past week and just noticed something really strange upon further testing. When you select the filter criteria and click FILTER, it populates the ...
0
votes
1answer
36 views

custom post type - project link output via single-portfolio.php

I have the following code registering metabox with form input used to input live project link function portfolio_meta_box() { add_meta_box ('project-meta', 'Add Project Link', '...
0
votes
1answer
19 views

How do I find out which (page) template file my custom child post is looking for?

I am trying to make something like a web-app with WP. One of the issues I'm facing now is that I cannot find out which page template file my post is looking for. I have looked at template file ...
0
votes
0answers
31 views

Cannot display the_content() after removed WordPress 5's auto embed feature (iframe & blockquote)

Novice here, please help. I made a dynamic page with Custom Post Type UI plugin where the user can input news updates. The information to be filled are date, title, and a link (a clickable button that ...
0
votes
2answers
86 views

Add custom template 'sub-page' to Custom Post type?

I have a custom post type called 'Inspections' Doing this, you can access an inspection record by going to example.com/inspections/inspection-slug-here However, I want to add some 'sub-pages' if you ...
0
votes
2answers
114 views

Custom sorting in post columns by ACF Pro Select Field

I'm adding a custom column to the admin display for a custom post type. The custom column should display the selected options from an ACF Pro select field. Instead, it always triggers as containing ...
0
votes
0answers
14 views

REST API Custom Namespace - unable to add/edit post

I have setup a controller class for my custom post type which extends the WP_REST_Posts_Controller class as I need some additional validation around whether or not the post can be viewed. A custom ...
0
votes
0answers
15 views

Suggestions on how to properly code a web form to submit CPTs from the frontend

I am looking for a way to code a secure web form to provide a way for my users to submit custom post types from the frontend on WordPress. Not really interest in using a plugin for this case though. ...
0
votes
1answer
9 views

URL for archive of custom post type with 2 taxonomy terms

I need to generate the URL of an archive page of custom post types with terms from 2 different taxonomies. The post type slug is "technologies", and the 2 taxonomies of this post type are "...
1
vote
1answer
24 views

How is this CPT code in functions.php adding a hidden “products” category?

Here is the code that I modified from https://www.wpbeginner.com/wp-tutorials/how-to-create-custom-post-types-in-wordpress/ /* * Creating a function to create our CPT * just drop this in functions....
0
votes
0answers
11 views

Use Custom Taxonomies as menu and sidebar

Nice to come back coding. I'm working on my new projet: http://www.abraselemcasa.com.br/ There, I have custom posts ans custom taxonomies as you can see below: The fist one is no hierarquical ...
0
votes
0answers
17 views

WP_Query() displaying past post / event

I'm making a page for past events (using Event Expresso plugin) and I'm kinda confused about the wp_query. This one works: $atts = array( 'title' => NULL, 'limit' => 100, '...
0
votes
0answers
14 views

Sortable admin columns ordering from custom fields isn't combine com search and Dropdown filter

I am developing a plugin that basically consists of a CPT that lists certificates (multiple) for their respective Customers (User Role). I've done everything that should be done: - The "Certificates" ...
0
votes
0answers
4 views

Show custom post type inside a specific page called Boards for sale

I am new to wordpress. I do create a page called "Boards for sale", and also create a custom post type called "Boards", so i can create as many boards for sale i need. This custom post type is ...
0
votes
1answer
42 views

How to build a WordPress post review system beside commenting

I have a Custom Post Type (CPT) and I want to have a Review system for this post type. I could not find any plugin which support reviews for the posts so I am thinking to do this with my own coding. ...
0
votes
0answers
37 views

Calling custom taxonomies

need some help with cpt having next-previous links with title or related posts. I'm using Oceanwp theme. For normal posts it show related posts. But for CPT, some code has to be edited. In the child ...
1
vote
0answers
17 views

How to get the upcoming post ID from front end?

Searching with "Next Post ID" is giving me the Previous/Next Post Navigation, but my question is not related to that. In WordPress Admin panel, when we're attempting to create a new post the post is ...
0
votes
1answer
20 views

How can I query and sort custom-post type using WP_Query

guys, I have a custom post type called "game" and it has some custom fields (get_post_meta) which I access by their keys "_game_date_key", "_game_home_goals_key" and "_game_away_goals_key". How do ...
0
votes
1answer
19 views

Pagination doesnt work in custom post type

Pagination template part includes common pagination function with style.The template part works for archive.php ( its for "single", you know default wp file ) but doesnt work for custom post type. ...
0
votes
1answer
15 views

Permalink for specific post type

A client has a WordPress website (4.8.13) running with the default post types and some custom post types. He wants to change the permalinks to use the post title, but only for the post post type. If ...
0
votes
1answer
31 views

Twillio How To Send SMS for Custom Post Type

Twillio has a tutorial where one assembles a plugin that sends SMS notices when 'post' is published. The issue I face is many 'post' types are published a day and that would generate an annoying ...
0
votes
0answers
15 views

Page not found - Custom blog type - Projects

I've been following a tutorial on how to create a template in wordpress and I've found myself stuck in a problem. My custom blog type: Project, when I click on it after adding some styling on the ...
0
votes
0answers
9 views

Have page with grid view and stylize certain posts differently

I wish to have a gridview displaying posts that when a post is of a custom post type displays differently from the others. I've seen many of the grid view plugins, but none of them seemed to advertise ...
0
votes
1answer
12 views

Route subpage to Custom Post Type

I have an artists-single.php page template which shows when I navigate to: /artists/djave_co Is there a way to route /artists/djave_co/anything to the same artists-single.php page? Then I can use ...
0
votes
0answers
13 views

archiv for custom post type

I have a date archiv for a custom post type. It's working as I want it to. But I would like to structure the links differently. Now it's looking like this: April 2021 April 2020 January 2020 ...
1
vote
1answer
25 views

Trouble with CPT Child 404

I'm having issues with some custom post types showing up as 404's. I have a website i've been running for about five years, that has a CPT called Videos, and a single PAGE which acts as the Videos ...
0
votes
1answer
15 views

Custom post type for text box that appears on every page

I want to create a custom post type for an entry that will appear on every page of a website. A few other CMS's have a 'globals' entry type for this. How would I go about this using Wordpress?