Questions tagged [custom-post-types]

Custom Post Types extend WordPress to support additional content.

Filter by
Sorted by
Tagged with
0
votes
2answers
16 views

How to validate custom fields for a custom post type before insert?

I'd like to know how to validate custom fields and return error notice (if necessary) before a custom post type is inserted into the database. After a little research I found one similar question ...
0
votes
0answers
14 views

Frontend posts table and post edit form

I would like to create profile page, where user can add, edit his own posts. The same functionality as in Wordpress admin, but at frontend - in the same style as the whole website. I want to have ...
0
votes
0answers
6 views

Trying to replicate archive\single url behaviour in a custom page

I created a custom page 'page-channels.php' since I get all the data from api requests I don't need or want to open a custom post type for channels but I would rather alter the behaviour of the page ...
0
votes
1answer
17 views

Accessing post's meta data based on user's click of a post

I am displaying a gallery of custom post types. When the user clicks a post, instead of redirecting to a single template, I want it to redirect to another page (too easy just change the link since all ...
0
votes
2answers
21 views

How do I control the output of a custom post type in the loop?

I'm working on a new content type. Let's call it hotel rooms (it is not but the similarities are good enough). Now, for each room, I will have a title and a description but I will also have a lot of ...
0
votes
1answer
24 views

Get taxonomy term by slug in post on archive page

I have a registered a custom post type called "projects" and assigned a taxonomy called "disciplines". Here's how it looks: <?php // Register projects cpt function projects() { $labels = array(...
0
votes
0answers
11 views

Removed slug from custom post type URLs page template issues

I use this function Remove slug from custom post type post URLs to remove slug from custom post type URLs .. but now I have issues... page.php is not working ... so now my pages with default template ...
0
votes
1answer
22 views

WP_Query of custom post type sorted by meta_key has unexpected results

I do not understand why my code outputs the events in a seemingly random order. It's not sorting by the start_time as I would expect. <?php $args = array( 'post_type' => '...
0
votes
1answer
15 views

Display custom posts, ordered by most commented, without duplicates

I would like to display custom posts in template, they have to be ordered by most commented and without duplicates on the same page. This is the code that I have for now. $args = array( 'post_type' =&...
0
votes
0answers
21 views

How can I build my own job posting plugin?

I'm looking for a way to create my own job posting plugin where someone can add, remove or edit jobs on the back-end of a Wordpress-website. I also need the ability to store the entries somewhere in ...
0
votes
1answer
29 views

Custom Taxonomy Page

I'm trying to create a page that shows all the subcategories of a specific category. So in context, I have a Parent Category titled 'Destinations'. I'd like to be able to click on Destinations and be ...
0
votes
0answers
15 views

How to display custom search results from a selected category of a custom post type?

I have a website that has a blog and a custom post type called proyecto. They are on mywebpage.com/blog and mywebpage.com/portafolio.Each of those pages have a search field and category dropdown ...
0
votes
1answer
11 views

Create Post Types from a XML url (Real Estate website)

I have a URL provided by my Real Estate service that lists, in a XML file, every apartment and house that I have to sell. The XML url lists every detail of every apartment, things like images, year ...
0
votes
1answer
18 views

Use WP_query to match post types based on custom field values

i'm trying to query posts from the post type Product that match with the current post in the loop from the post type Item, based on the custom fields product-ean and item-ean. For example: i have a ...
-1
votes
0answers
17 views

Hierarchical Menu for Catalog Site

I'm new to Wordpress and want to make a catalog site with a menu system like HomeDepot.com, Target.com, Walmart.com, etc. but without the option to purchase items. I have created a Custom Post Type ...
0
votes
0answers
15 views

Creating Site with Menu Like HomeDepot.com Without Cart/Purchase Option [closed]

I'm new to Wordpress and want to make a catalog site with a menu system like HomeDepot.com, Target.com, Walmart.com, etc. but without the option to purchase items. My needs are listed below, and I'...
-1
votes
0answers
10 views

Custom Post Type next to products in Woocommerce [closed]

Is it possible to register an custom post type (Services) with all the Woocommerce fields (inventory, price etc.) next to the build in post type products?
0
votes
2answers
16 views

How select query is generated in a Custom Post Type?

I have this table that is generated in a Custom Post Type (CPT) Is there an option that I can modify the query? For example, I have this post_type = 'my-type' in wp_posts table. I want to do a JOIN ...
0
votes
0answers
19 views

Post slug changed using code doesn't reflect on editor when post is published

I've a CPT (lets say Event) with a custom date field (start_date). I'm trying to generate the post slug (post_name) as start_date + post_title (separated by -). I've tried using the filter ...
0
votes
1answer
11 views

Creating custom “player-objects”

I'm looking for a way to create "player-objects" that are then all displayed on one page. They should just contain a few text-datafields with the players name, role and an image. Since I'm very new to ...
0
votes
0answers
5 views

Create an alphabetic glossar for multiple post types

I have created two post types films and film reviews. The slugs are "filme" for "films" and filmkritiken for film reviews Both should have an alphabetic glossar. I've already try to adapt the tutorial ...
0
votes
0answers
11 views

Post content is escaped when visual editor is turned off

When visual editor is turned off, then $post->post_content is escaped. With visual editor turned on, the exact post content is obtained as saved. When visual editor is ON, output of $post->...
0
votes
1answer
21 views

Displaying custom fields for custom post type generate with Custom Post Type UI Plugin

First, I am using default theme twentyseventeen. I've used plugin Custom Post Type UI to create a new post type called film_kernal For that post type I have created some custom fields, one of which ...
1
vote
1answer
33 views

Custom search with Custom Fields in WP REST API?

Good morning! Is there any way to do searches with the WordPress REST API with custom fields, being more specific, I have some custom posts, with a custom field of a specific date, and I want to do a ...
0
votes
0answers
16 views

ACF post object relationship display odd even

I want to display an ABBAABBA of chosen posts created with ACF. But my loop displays the posts twice when i use the following: for ($i = 1; $i <= 2; $i++) { ...
0
votes
0answers
20 views

Regex with a possible hyphen

I am working on a site for cars. I wrote a regex which worked, up until the point where brands are separated by a hyphen. These are 2 examples I want to match: class-s/ford-shelby-gt350r class-s/...
0
votes
0answers
27 views

Adding custom post types to archive

I am wanting to dispaly custom post types on my archive pages using code from here: Adding custom post types to archive.php but this now gives WP error message of: Warning: Invalid argument supplied ...
0
votes
1answer
14 views

Expose a custom field of a custom post type to the REST API

I added a custom field to posts and exposed it to the REST API, which works for standard posts and appears in the APIs response. But does not work for a custom post type (projects) which is basically ...
0
votes
0answers
22 views

How to use ACF and CPT to create a shortcode for conditional objects

I am trying to create a shortcode called [brand_collection] with the attributes brand and collection. The shortcode with create a table from a custom post type with ACF on it. here is my ACF setup [ ...
0
votes
1answer
12 views

Custom post type rewrite slug translate?

I use 'rewrite' => array('slug' => 'uniquename') for custom post type, and I will have site in two languages. I tried to use if( is_main_site() ) { $slug = 'uniquename' } else { $slug = '...
0
votes
0answers
34 views

Trying to display related custom posts only in same child taxonomy as current custom post

I have some custom post types 'home' and 'provider' that share a custom taxonomy 'states'. The taxonomy is hierarchical so Georgia is a parent of Atlanta etc. In the single template for the post type '...
0
votes
0answers
23 views

Compare ACF Date field to today or yesterday

This is a very simple question, but for some reason having challenges with it. I have set up ACF field group. I wanted to compare a "date field" to the current "today's date" and "yesterdays" date. ...
0
votes
0answers
26 views

What should I use to develop a activity logger? [closed]

I'm developing a plugin with Wordpress and I want to save all user activity regarding my plugin. I would like to know if the best way to code it is to use CPT or create a custom MySQL table. I think ...
0
votes
0answers
12 views

Lost my work progress somehow

I'm a newbie working on a locally hosted eCommerce website and recently when I tried to edit my homepage with elementor somehow my recent update were gone and in revision it showed that I last updated ...
-1
votes
0answers
14 views

Include posts by taxonomy type [closed]

So I have this webpage here https://100awesome.net/redstone/ with a posts widget. Using the plugin custom post type UI I created my own post type called videos. Videos has a taxonomy named subjects ...
0
votes
0answers
13 views

How to give a single user with a custom role viewing access to selected pages or custom post type pages?

I'm trying to create a client portal. The goal is to send a single page/CPT link that only a client can view so I can get feedback. Ideally, the client would log in and be restricted to only see ...
0
votes
0answers
12 views

Register custom taxonomy for all post types but list under pages

How I can register one (or more) custom taxonomy listed under "Pages" in the wp-admin menu but to be usable on the all other (registered) custom post types? Here is code what I use: ...
1
vote
2answers
27 views

Show custom post archive when custom post not specified

I have a custom post type called produce set up in WordPress and a custom taxonomy called produce_category. The URL format for posts in this custom post type is in this format http://mywebsite/...
0
votes
1answer
16 views

Custom Post Type - custom form in dashboard

I've created my custom post type, let's say called FAQ. I've created it in functions.php. I can also display it in dashboard. The thing is, I don't know how to create form in dashboard, when he clicks ...
0
votes
0answers
23 views

WordPress Custom posts view

It is possible to show custom posts as attached. Top th are post's meta field with Day/Dates Most left and right cols are time stamp that will be hard coded. And bottom of day/dates there are posts ...
1
vote
0answers
14 views

How to get post type and month/year before while loop for date.php file

I am trying to create a date.php file for archives for some custom post types. I am using a while loop to get the posts: <?php while (have_posts()) : the_post(); ?> I want to customize the ...
0
votes
1answer
23 views

WordPress hook after post content and meta update

I want to update one of my meta field and redirect and I am using post_updatedhook. Here is my code. function job_publish_status( $post_ID, $post_after, $post_before ) { $job_published_date = ...
0
votes
0answers
15 views

Can selected taxonomies be used dynamically to display information?

I’m creating a business directory site in which users will create a business listing and while creating that listing, select certain amenities they offer. I’ve created several taxonomies to be used ...
0
votes
0answers
12 views

How to display links to the previous and next post in the category?

How to loop the output of posts when I click on the "Forward" or "Back" buttons so that there is a transition in the same category as the previous post. And now, when posts of a certain category end, ...
1
vote
0answers
36 views

Show custom post type relationships by taxonomy

I have two custom post types product and review. The product have a custom taxonomy fruits with terms apples and bananas. All review has a custom field that is a relationship to product, so I can ...
0
votes
0answers
11 views

How to add a custom page in wordpress

I run a cron in my server which updates a file with the name of backdating like today is 2019-12-25 my file name will be 2019-12-24.zip. My cron add that file as per folder like wp-content/12 (for ...
0
votes
2answers
32 views

Cannot modify header information - header already sent (CPT related)

Cannot modify header information - headers already sent by (output started at /wp-includes/class-wp-post-type.php:613) in /wp-includes/functions.php on line 6029 This error has seemed to follow me ...
0
votes
1answer
22 views

How to access repeater field of a custom field?

I have a custom post type called donation_group it has a custom_field called donate_pages which is a repeater field. This donate_pages has again fields called donation_object and amount_received. I ...
0
votes
1answer
18 views

Query not work for current taxonomy

Hi i want to show current taxonomy post type count by month but it show total post count istead of current tax. please help me. i am trying to solve this problem almost 3 weeks. <?php $...
0
votes
0answers
21 views

The same rewrite slug for multiple taxonomies

I'm using the plugin custom post type ui and I have a custom post type with multiple taxonomies and I'm trying to get my URLs to work. Custom post type → works Taxonomy1 → works_cat Taxonomy2 → ...