Questions tagged [custom-post-types]

Custom Post Types extend WordPress to support additional content.

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

Error with Custom post type page with custom loop showing custom post taxonomy term by slug

I have a website with custom post type Pages called 'mini_site_page' I also created a custom post taxonomy in Posts called 'mini_site' and I check taxonomy inside the custom pages I want to show ...
0
votes
0answers
15 views

Different comments section for different user roles

I have website. in this website people can post complaints about customer satisfaction of companies. Company and complainer (who is author of this complaint post ) can do discussion under post. so i ...
0
votes
0answers
12 views

background featured image display using shortcode

I created a slider shortcode in my custom theme. My sliders images display at the background image. I don't know how can I display background slider images using shortcode Here is my code: $string .='...
0
votes
0answers
5 views

Conditional editing CPT - using editor's role and author's usermeta

I have created a custom post type. Each author is attributed to a editor group when her/his account is created. This is save on the author's user meta I created two roles with administrator ...
0
votes
1answer
16 views

How to create a custom template for a custom post types category

I'm working on a custom post type and need to assign a new template to one of the custom post types categories. So far i've tried adding a new categories.php file with the category name at the end, ...
0
votes
1answer
10 views

How to create connection among state, city, store and store number based on URL

I'm about creating a store in which I have state, city, store, and store number, so what is the best way to create a connection among them? Is that okay if I create CPT with name store then create ...
0
votes
1answer
32 views

How to display posts with plugin (advanced custom fields) field groups?

I have a php/wordpress code (present inside abc.php file) as shown below which displays images of particular size. php/wordpress: <ul id="list-thumbs" class="list-grid"> ...
0
votes
1answer
4 views

How to prefix custom post type URL with custom post taxonomy term?

For one of my CPT, when default permalink looks like example.com/CPT_slug/%postname% instead I would like a permalink like this : example.com/%custom_taxonomy_term%/CPT_slug/%postname% With regular ...
0
votes
0answers
9 views

Limit users ability to display and publish posts

I'm using vuejs to provide the front-end for some websites that will share the same wordpress installation. I'm using the users account to give the users the ability to create and publish their ...
0
votes
0answers
7 views

Page template defaulting to index.php

I have a custom post type registered but don't want to use the archive page for it. I instead want to use a page template and just run WP_Query on it. On my localhost this works 100% but when ...
0
votes
0answers
7 views

How to display the related post from the same category?

I am displaying the related post using the below code but I am getting all the posts, except the current one because I don't want to show the same post in the related post. I have to show the related ...
0
votes
0answers
31 views

Define multiple prefixes for custom post type

I have created CPT called "Pharmacy" which have a lot of pharmacies inside (approx 10.000) Pharmacies offer 2 different services (skin & scalp) and some provide both services but some ...
0
votes
0answers
9 views

How avoid error 404 after add post id to slug for custom post type? (post_type/%post_id%-%slug%/)?

I want to have permalinks which will be look like: example.com/mypost/%post-id%-%slug%/ And the following code do it. But when I try to go to url of the post... I get error 404. I have this code: To ...
0
votes
0answers
7 views

Display two items from a custom post type that have 2 different taxonomy terms but output different HTML in the loop for one of those terms

sorry if my question title does not make much sense, I couldn't think of a good way of wording it. Essentially, I currently have some custom loop code on single.php that does the following: If a ...
0
votes
0answers
12 views

previous_posts_link & next_posts_link doesn't generate any output

Hey I am using a WPQuery to loop through and show blog categories in posts. It's in a page tempplate. has 21 posts and I want them to show 10 per page with navigation links for next pages of 10 posts ...
0
votes
0answers
19 views

get_post_meta in custom table

I made two versions of a bibliographic plugin. In one use class wp_list_table + CRUD with a specific table (web_datos). In another use post_type + custom fields. Both work, although improvements are ...
0
votes
1answer
18 views

Get category name of custom post type

My code returns category name of default post type "post": <div class="row masonary-wrap"> <?php $args = array( 'post_type' => 'project', 'post_status' => '...
0
votes
1answer
11 views

Wordpress - display relationship between blog posts and custom posts

I created through ACF a relationship between blog posts and the custom post type, which contains employee profiles. Through the relationship, I am able to display links to the employee's profile, who ...
0
votes
0answers
28 views

Display category filters for custom post type when category is shared by multiple post types

I already have a solution to this problem but I'm wondering if there's a more efficient way to do it. I have a custom post type called "galleries" that uses the same taxonomy as blog posts. ...
2
votes
1answer
25 views

How can I list all custom post types in a block

I want to show the list of all available custom post types in the settings of the block in admin. How can I do that? Later I want to show a dropdown with those post types which user can select and ...
0
votes
0answers
17 views

How to only display all posts to a custom User Role?

I have a custom user role and I want to display all custom website posts to them, without letting them edit/delete them. Right now the custom post doesn't show up in their dashboard. I know it will ...
1
vote
1answer
24 views

Why is my Custom Post Type not showing up after adding capabilities?

I'm trying to add a custom post types with capabilities, so a custom user role can do certain things with them. Eventually the custom role is a Client, and the post a Website, and I want clients to be ...
0
votes
1answer
12 views

How to add a sub directory to WordPress single posts without affecting other post types?

I've been trying to add a subdirectory to my blog post's permalink for example domain.com/blog/post-slug/ However, this is affecting the other post types that I've created using Pods such as domain....
2
votes
1answer
51 views

Having trouble with custom date field for CPT query (Wordpress)

I've read as many of the questions and answers on here as I can find and none of the solutions are working for me. No idea what I'm doing wrong here. I have a CPT 'event' with meta key 'start_date' - ...
0
votes
0answers
50 views

How to get the custom page get_permalink?

I have create two a custom page called page-blogs.php and page-blog-content.php. In the page-blogs.php I am displaying my all the custom blogs post and page-blog-content.php will display the blog ...
0
votes
0answers
20 views

Display 10 popular tags of custom posts of curent custom taxonomy term

I want to display 10 popular tags in current taxonomy. ok i can display popular tags of total tags but i need to display tags (with post count) of custom posts of current custom taxonomy term. please ...
0
votes
1answer
16 views

Do posts, pages and / or custom post type objects have unique ID numbers or can there be multiple objects with the same IDs?

What are the canonical rules for the ID numbers of posts, pages and CPTs? Especially as they are created programatically.
0
votes
0answers
18 views

Show all entries from an ACF Field

I have used ACF Pro fairly successfully thanks to these forums and I am back once again for help as I am clearly not a programmer! I created a new WYSIWYG field and added it to my Custom Post Type. I ...
0
votes
0answers
31 views

How to add field to custom post type endpoint

I have an endpoint in this address: example.com/wp-json/wp/v2/myendpoint I want to add a field to the endpoint with these codes: add_action( 'rest_api_init', 'create_api_posts_meta_field' ); ...
1
vote
0answers
22 views

Permalink for a custom post type isn't working and I don't know why

I think this question was answered a lot, but despite all threads I couldn't find a valid answer: I'm working on a website with Wordpress (and without any plugin). Here the creation of my custom post ...
0
votes
0answers
58 views

Modify Custom Post Type Slug

I have a CPT called 'projects', which display images with their titles. I have a page to display the CPT's called 'single-projects.php'. Is there a way through using templates and/or functions, to ...
1
vote
0answers
17 views

Return the latest post from a custom Taxonomy and Post Type

CPT called: updates Custom Taxonomy called: systems What I was trying to do was loop through all my posts in a CPT and display the '1' latest post from each of my 'I think they're called Terms' (it's ...
1
vote
1answer
36 views

Found 2 elements with non-unique id (#_ajax_nonce) and (#_wpnonce)

I am developing custom theme from scratch and creates a custom post type and getting this warning while editing custom post type. I also design custom Meta box with two input fields and using nonce in ...
0
votes
0answers
14 views

Add class of active faq

I create a custom post type for faqs. Now I want to add class of active faq but its add all items active here my code: <?php // get current page/post ID ...
0
votes
1answer
28 views

Custom post type and standard post not displaying or working

I want to display 5 images of custom post type 'project' and 1 standard post in the front-page. I have tried to merge both queries in one, however its not working. FYI: I have set the theme support ...
0
votes
1answer
26 views

WordPress Custom Post Loop

I am trying to loop through the custom WordPress posts and have an issue like I add the custom field and want to display it in <li> using loop. I did it successfully but the data/link/category ...
0
votes
0answers
24 views

How to debug failing updates for custom post type?

Issue Overview I have a post that I am working on for a few days, when I try to update it I get a error updating failed. Steps to Reproduce (for bugs) Make a post Select a sub industry taxonomy Save (...
0
votes
0answers
17 views

Display images on front-page static or custom post type?

I am currently learning Wordpress development, building out a portfolio theme. I would like advice on what's the best way(noob question), development wise, to dynamically display featured images on ...
0
votes
1answer
25 views

Change custom taxonomy archive permalink

I have created a custom post type named video and a custom taxonomy for video as video_category. I have created a page template with the name taxonomy-video_category.php. So that the categories of the ...
0
votes
0answers
7 views

How allow admin to manage textual information in a custom post type page?

I have a custom post type allowing to create articles as meals. All that meals are rendered in a specific page. I want to add information about menu & prices on top of that page (like a banner ...
0
votes
0answers
22 views

Disable comment flood protection for specific post type

I am trying to disable comment flood protection for a specific custom post type. So far I have tried the following: function filter_comment_flood_filter( $false, $time_lastcomment, $time_newcomment ) {...
0
votes
0answers
9 views

Easiest and most elegant way to make comment form appear as popover (using ajax preferably)

What is the most simple/robust/elegant way to make my comment forms appear as a popover modal? I have many CPT elements appearing on the page, so AJAX would reduce the initial load time. Here is the ...
0
votes
0answers
35 views

How to modify a query in functions.php to involve both post_title and fields from wp_postmeta?

On my Fusion Builder powered WP website I have created a CPT called movies. The title of each post (i.e. each movie) has a post_title property which is located in wp_posts table, other custom ...
0
votes
1answer
21 views

What is the diference between Post Metadata and Queried Object

When I edit a Submitted Essay post and look at the Post Metadata using the plugin JSM's Show Post Metadata. I cannot see comment_status. But when I view the post using the Debug Bar and look at the WP ...
0
votes
0answers
11 views

how to add share buttons below any image inside the post?

I have a function of sharing buttons which i have added in function.php of my theme using filter hook,Now I want to hook same function below the image of my post(not featur image),which filter hook ...
0
votes
1answer
23 views

post_type internal ID?

This may sound like a stupid question, but is there something like an ID associated with the post types (built in or custom) in WordPress? I'm not interested in the actual post id, but wondering if ...
0
votes
0answers
21 views

Wordpress next post by ajax call on button click

I have an archive of custom post type "Trivia" where I want to display next custom posts on click of a button "Next Post" I have this code for displaying 1 post on archive page: $...
0
votes
1answer
41 views

Store a value in global scope after init hook is fired

I am working now on a Settings page. As I will need data about post types, taxonomies, and posts repeatedly in my setting page, I preferred to get these variables in the global scope and call them in ...
0
votes
0answers
14 views

Why this didn't work if i use get_the_ID(), but works if i pass the numeric id

It is a custom meta box that handles pdf upload. I want to get the URL of the uploaded file. Inside admin, it works but on the homepage, it doesn't work. function moin_notifications_get() { // ...
0
votes
0answers
15 views

How to export only custom taxonomies for each post in CSV/JSON format?

I have one wordpress website running with 100+ products (woocommerce) and i had to export & import the products into another wordpress website. However, products have custom taxonomies that were ...

1
2 3 4 5
192