Questions tagged [custom-post-types]

Custom Post Types extend WordPress to support additional content.

Filter by
Sorted by
Tagged with
0
votes
0answers
8 views

Custom taxonomy rewrite give pagination 404

I have a Custom taxonomy with this rewrite: 'rewrite' => array( 'slug' => '/', 'with_front' => false), So every term will look like this: https://example.com/term/ the problem with the ...
0
votes
1answer
9 views

custom post type and user post count shortcode

Hello i m a newbie in php and Wordpress development. I was struggling to get a user custom post count in my wordpress/buddypress site frontend. i m using this code: // add [author-post-count] ...
0
votes
0answers
5 views

Sort order of tags on post by post basis

I would like to be able to add an order to my custom taxonomy tags per post, so when I call them on the front end they go into a certain order. So one post might have the tags ordered "James"...
0
votes
1answer
10 views

How to duplicate entire custom post type

I have a custom post type created in my theme, the post type is called "Portfolio". I would like to entirely duplicate this custom post type and give it the name "Projects" so it ...
0
votes
0answers
8 views

Custom Admin Page equivalent to Posts page with custom meta values

I'm creating a custom admin page for CPT (Custom Post Type) in WP-ADMIN returning posts with their taxonomy that should like Posts List Page I am able to display list of posts for a given category, ...
0
votes
1answer
14 views

Empty search input does not return all posts

I am working on wordpress custom post type search functionality. When I have searched with empty value it does not returns all posts. When I am using this below code global $wp_query; echo $wp_query-&...
0
votes
1answer
27 views

get_posts wont produce a list of custom type from a given category

Hi, I created a custom post type called "news" and custom categories called "news_category" to have them categorized. I want to list "news" posts that belong to one of ...
0
votes
0answers
26 views

How do I troubleshoot pre_get_posts with Debug Bar?

I am using pre_get_posts() on a custom post type Archive page, to change the sort order. When I view the query using Debug Bar and WP Query Monitor, I can see that my action is indeed firing. If I ...
0
votes
0answers
18 views

Best practice to show table data with filtering option

I have a database of foods and their nutrition values that needs to be shown on the website based on schema.org templates. The data needs to be displayed in one table with a big amount of data( nearly ...
2
votes
1answer
36 views

Make `previous_post_link()` Function Show The Post After Next i.e. Jump A Post

Is it possible when using the previous_post_link() function to make it get the previous post after next i.e. make it skip a post. So if you're on post 5 in numerical order it skips to post 3? The ...
0
votes
0answers
22 views

Cant list custom type posts based on category

Hi, I want to list posts which belong to custom type "news" under a certain category. This is my code: <?php $news = get_posts( array( 'post_type' => 'news', 'category' =&...
0
votes
1answer
41 views

Why it doesn't create a custom post type after form submitting

I have a form where users can save/update their profile. I'm trying that at the same time they can create a custome post type (channels) with some of the info set on the form. Here the code: /* mY ...
0
votes
0answers
12 views

WP_Query doesn't work properly in CPT-UI

I created my own template for a CPT. A loop with the content of a certain post type is to be shown here. Except for a couple of "little things", it actually works. However, there are a ...
0
votes
1answer
31 views

How do I Create Single template for custom post type with a custom URL?

I have a live website that is using the custom post type "virtual-programs" and I have a template that currently works called single-virtual-program.twig and single-virtual-program.php. I am ...
0
votes
1answer
18 views

How to display the post using a shortcode in WordPress?

I am trying to display all the post on my page but it's not displaying. I am using the below code and I added the shortcode gridPost on my page. I am getting the only UL LI but not getting the title ...
1
vote
0answers
20 views

Add custom post type settings to wordress default posts

When I create custom post types in wordpress I got the following site structure which works perfectly with Permalinks "/%category%/%postname%/": Preview and category page: [main]/animals/ [...
0
votes
0answers
7 views

Show selected variation name on single product page

I'd like to show selected variation name on single product page. For example I select Black, it will show "Color: Black". It is easier for customer know what color they select and get no ...
1
vote
0answers
11 views

Changing wordpress publication date to ACF date and time picker date not working

This might be a long post but I want to explain in detail what I'm trying to do and what I've already done. I'm making custom forms using the advanced custom fields plugin and I need to display these ...
2
votes
3answers
73 views

Pull Two Posts Into Custom Post Type `single-cpt.php`

I have a custom post type and in the CPT's single-cpt.php file I would like to pull in two posts instead of one. The two posts will be the post the user clicked in the relevant archive, and the next ...
0
votes
1answer
9 views

WP_query has incorrect wp_posts.post_name = 'asc' when I have custom post type called 'order'

This is my code : print_r($args) //Output array(6) { ["post_type"] => string(9) "order" ["date_query"] => array(2) { ["before&...
0
votes
1answer
18 views

Send a conditional email notification when a custom field value changes in Post Type

I have added a custom field "Registered"(field type = checkbox) through ACF on Post Type. When I change the value of the custom post field "Registered" with a check, I want to send ...
0
votes
0answers
28 views

How to trigger a function when submit a form

How can I make work these functions not just when the user profile is updated. Also when a frontend form is submited? Here the functions: function get_channel_by_author( $user_id ) : int { // if we ...
0
votes
0answers
12 views

Creating custom post type for Authors in Woocommerce

I'm trying to integrate the ability to search for Author profiles with the JetSearch plugin. Currently it does not allow for users to search for/by Authors. However, it has the ability to search by ...
0
votes
0answers
10 views

How do you create pillar content pages?

I'm trying to create a guide/pillar page with subpages and I'm kinda lost. I'm going for something like this: https://www.digitalmarketer.com/digital-marketing where you have /main-keyword/sub-keyword ...
0
votes
1answer
13 views

What is the correct way that when creating a custom post type assign values to custom fields created with pods framework?

I am trying to create a custom post type input using the wp_insert_post function, this custom post type called game was created using the pods framework and contains a series of custom fields which I ...
0
votes
1answer
77 views

Pagination custom post type not working with rewrite slug

I can't find the way of making my pagination to work on my post type (this is not on an archive-posttype.php). I've rewrited my post type, but the second page isn't working if I do the rewriting (&...
-1
votes
1answer
13 views

How to laod wp_enqueue_style to another header i created my self

How to laod wp_enqueue_style to another header i created my self name of the header manga-single-reading.php wp_enqueue_style code in wp-manga.php the code is wp_enqueue_style( 'wp-manga-plugin-css', ...
0
votes
0answers
9 views

Qty Increment Buttons for WooCommerce not displaying even after stock is 200pc for a product

Qty Increment Buttons for WooCommerce : Hi Guys , i am using OCEAN-WP Theme. I have a product lets say shirt with SKU:7943. Its inventory is 200 pcs for size XL. Now , when i surf a single product ...
0
votes
0answers
9 views

I want to add HSN CODE,BARCODE TO INVOICE AS WELL AS ON ORDER PAGE IN WOOCOMMERCE? [closed]

I want to add HSN CODE,CUSTOM FIELD, BARCODE TO INVOICE(pdf) AS WELL AS IN ORDER PAGE(ADMIN) IN WOOCOMMERCE? I ALSO WISH TO EXPORT THESE FOR FUTURE TAX USE IN GST. any solution would really be ...
0
votes
1answer
20 views

How to properly rewrite pagination rules for a CPT to avoid 404 error on /page/2

I have custom post type called News and a static page that uses a custom template (page-news.php) and indexes all the news posts under homepage.com/news url. The problem is that I want to paginate the ...
1
vote
0answers
13 views

Displaying CPT and custom taxonomy side by side in Bootstrap 4 component

I'm trying to reproduce a bootstrap navigation component inside a page that display sub category and associated posts to those sub-categories like this: Taxonomy term 1 taxonomy sub-term 1 Post 1 ...
1
vote
0answers
10 views

How to sort custom columns for custom post type without meta query and pre_get_posts?

I have a custom post type orders and multiple custom columns. I've added the custom columns with the manage_orders_posts_columns hook and registered the columns as sortable with this hook: manage_edit-...
1
vote
2answers
23 views

How to make wp_enqueue_style and wp_enqueue_script work only on custom post type

How to make wp_enqueue_style and wp_enqueue_script work only on custom post type I have install plugin on my wordpress that creat custom post type which is "http://localhost/wordpress/manga" ...
0
votes
2answers
53 views

After creating Custom post type by user delete old one

I have created a form where users update their profile. When a profile is created or updated it creates a CPT called course. The url is the permalink + /course/ + the title of the course /* CREATING ...
0
votes
0answers
6 views

do I have a duplicate from Reference post and connect it's content to edit post?

I have a WordPress blog. that have common content in each post. I want to create custom post type and custom field for any media that can have the same data and just I will write each time different ...
0
votes
0answers
16 views

Custom Post Type loading as Blank Page after Upgrade from PHP 7.0 to PHP 7.1

My custom post type page loads as a blank / white page in the back-end when upgrading from PHP 7.0 to 7.1. The page to "add new" and the front-end still work fine though. Any versions before ...
-1
votes
0answers
8 views

Single page editing option via forms fields

My clients want a multisite WordPress website which his staff will be able to edit only content(and nt design)using forms and not site builder. So for each block in a page there will be a form field. ...
0
votes
1answer
21 views

when looping through custom post data not appearing

i have a loop that fetch custom post type from the database now when i go to the page the data doesnt appear but when i refresh the page 2 times the data shows here is the code: <div class=&...
0
votes
0answers
12 views

How can i enter common data in each post with custom fields?

I have WordPress blog. that have common content in each post. I want to create custom post type and custom field for any media that can have the same data and just I will write each time different ...
0
votes
0answers
15 views

Using CPT slug within taxonomy rewrite causes 404

I have set up a CPT called 'recipes' and have added a custom taxonomy under this called 'categories'. (The main purpose of this is to separate the recipe categories from the blog categories) I am ...
1
vote
0answers
39 views

Use Custom Post Type archive page for the taxonomies term archive page

In my wordpress theme I created a new custom post type 'books' with 2 taxonomies ('series', 'genres'). when I visit the archive of the cpt 'books' (site.com/books), I list all the books. I added a ...
0
votes
1answer
14 views

Custom attachment function not working in v5.4.2?

I have a function that I re-use in a number of custom themes when required to fulfil a customers need. I understand this can be achieved now with repeaters in ACF Pro but as I had a working function, ...
0
votes
0answers
40 views

Publishing failed. The response is not a valid JSON response

I am using wordpress 5.4.2. I get this error when trying to add a new post. I changed my permalink to Post name sample http://localhost/wordpress/sample-post/ How should i change my .htaccess My ...
-2
votes
0answers
31 views

How to update meta fields (Real Homes - real estate theme) with an external app using REST API? [closed]

I have an app written in Delphi and Indy components for Windows platform, with which i can edit most of the data on my site using REST Api. The site is working under WordPress, with Real Homes theme. ...
0
votes
2answers
18 views

Get all post types that supports tags

I'm trying to get all the post types that has tags functionality. I searched a lot but couldn't find a conditional or something for that. I need a way to get post types or post objects for the posts ...
1
vote
0answers
26 views

WP_Query order by custom field, then randomly order some of results

I'm not entirely sure how to word my question, but I'll give it a go. Basically, what I'm wanting to do is order a group of posts by a custom field. I have a True/False custom field, created using the ...
0
votes
2answers
20 views

Can't save meta box data in Wordpress using custom post types

I've created a meta box. The code is: /** * Add meta box * * @param post $post The post object * @link https://codex.wordpress.org/Plugin_API/Action_Reference/add_meta_boxes */ function ...
0
votes
1answer
15 views

add all blog posts to folder

I want to add all the blog posts to the /blogs/the-post-name type structure. I can do this through the permalinks settings with: /blogs/%postname%/ but this also affects custom post types resulting ...
0
votes
0answers
12 views

How can I make users add custom post type to their profile?

I have a custom post type called "exercise" with custom fields via ACF. In the front-end, inside the custom post type, I want to display a button where users can mark current viewed exercise ...
0
votes
0answers
25 views

How to avoid duplicate posts queried from custom meta?

I'm querying custom posts taken from a custom metabox where you pick which posts to display to be used as criteria for filtering. How do I avoid duplicates? Current code (displays all authors - the ...

1
2 3 4 5
190