Questions tagged [custom-post-types]

Custom Post Types extend WordPress to support additional content.

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

How can I filter records in a custom post type list in the admin based on the ACF field in the post that contains the current user?

I have a custom post type called Projects that includes an ACF field named team_members which uses User as a field type and returns a User Array. I want to filter the post type listing so that the ...
Rizal Kholif's user avatar
0 votes
0 answers
8 views

Add custom text in /post.php?post=503&action=edit

I'd like to know how to add a custom text like "Hello world!" inside the edit post.
winona's user avatar
  • 131
0 votes
0 answers
9 views

edit index custom post type page with elementor or other

i have a custom post type in wordpress like book. i can edit single pages template with add single-book.php file and edit archive pages template with archive-book.php file. i know main page of this ...
milad taghizade's user avatar
0 votes
0 answers
19 views

Pagination Links for Custom post type returns 404 [duplicate]

first of all, I am new to WP development, and PHP. I am developing a template that has several custom post types. the problem is when I add pagination to my custom post type, all pagination links ...
Ehsan Aliverdi's user avatar
0 votes
0 answers
21 views

How do I add a filter to my custom post type archive page?

I used the guide HERE from acf themselves, but for some reason whenever I attempt to query anything at all in the url I get the "There has been a critical error on this website" error. $...
judahking's user avatar
0 votes
0 answers
17 views

Custom Block: Adding "Post Type" dropdown to Sidebar Settings

I'm pretty new to React, so I'm trying to find the simplest and most PHP-based way to achieve my goal. What I've accomplished so far Created custom blocks using the @wordpress/create-block package. ...
beat's user avatar
  • 1
0 votes
0 answers
13 views

How to create a WP Bakery template for a custom post type [closed]

I've set up a custom post type for my WordPress website through ACF Pro. I would now like to create a design for the single posts in my custom post type. I'm using WP Bakery on my website and I'm ...
ThibaultG4U's user avatar
0 votes
0 answers
24 views

Custom post type slug localization

I need to have 2 languages in a website (EN and LT). I have a custom post type 'services'. I need to have the links like this: English version of the service: '/en/services/some-service' Lithuanian (...
LinasK's user avatar
  • 1
-1 votes
1 answer
30 views

Add taxonomy or category slug to custom post types URL

I have created a custom plugin that is similar to Woocommerce but will only manage products that are loaded using the WP REST API in a Vue SPA. I've registered two custom post types, one for products ...
ICTDEV's user avatar
  • 113
0 votes
1 answer
15 views

WP Query filtering by custom category not showing all relevant posts

Here's a question I've been trying to solve all day: I added a WP Query that would show posts from a category that the admin chooses with a custom field. The post is a custom post type called "...
Jillian Hoenig's user avatar
0 votes
0 answers
6 views

custom post type dynamically shows in menubar in wordpress

I am developing a hospital website in wordpress. For that I make a custom post type "Services". All the hospital services (ex:ICU, CCU, NICU, Emergency etc) are going under this "...
Raff's user avatar
  • 1
0 votes
0 answers
17 views

Wordpress next/previous post link

I need help, please. I'm a newbie on Wordpress. This code is working: $previous_post_url = get_permalink(get_adjacent_post(false, '', false)); $next_post_url = get_permalink(get_adjacent_post(false, ''...
ile's user avatar
  • 1
0 votes
0 answers
19 views

get_posts() return NULL using a custom plugin and add_submenu_page() with Post Type

Inside a custom plugin and using add_submenu_page() for custom post type I want to display one post. As the other post_type I use get_posts($the_id, $arr_params) to get information about it, except in ...
imagIne's user avatar
  • 41
0 votes
0 answers
7 views

Quiz page template, checked attribute missing when option selected

I would like to add a quiz page template to my WordPress site. Part of the template is the code below. The problem is that when any of the inputs is selected, the checked attribute is missing. <div ...
Kostas Stoumpos's user avatar
0 votes
1 answer
13 views

Why does have_posts() return false when in the wordpress admin, but not on the frontend?

Background: I'm new to the Gutenberg block editor and I'm trying to develop a custom block theme. I'm using ACF to create custom blocks. Problem: I'm creating custom blocks with the intention of ...
Danielle's user avatar
0 votes
0 answers
39 views

Include theme header and footer in custom plugin

I am working on a custom plugin. I created a custom post type inside my plugin. Now, for single posts I want to serve a custom template using my custom plugin without touching any theme file. The ...
Farhan Ali's user avatar
0 votes
0 answers
9 views

How can i show multiple post on single post wordpress, just like therichest.com or screenrant.com or hotcars.com.?

How can i Show multiple post with same categories using infinite scroll on a single post page.
Ankush Choudhary's user avatar
0 votes
0 answers
37 views

Cannot create custom post types with a specific name

I am creating custom post types using this code function create_custom_post_type() { register_post_type('courses', array( 'labels' => array( 'name' => __('...
Waleed's user avatar
  • 1
0 votes
2 answers
35 views

Is it possible to create a custom post type with blank page for Post List and Add Post Page only?

I would like to completely reorganize, stylize a custom post type. By default register_post_type() function add Title, editor, category and tags into add custom post from $supports argument. Can I ...
imagIne's user avatar
  • 41
0 votes
0 answers
15 views

Custom templates based custom url structure in wordpress

I'm working on a website that includes a section for Barbers, and I want to achieve the following URL structure: Barbers {domain.com/barbers This page will have 2 section, 1 section will list Barber ...
Tarun's user avatar
  • 1
0 votes
1 answer
29 views

Redirect WordPress page to the latest created post by the logged in author/user

I have a basic WordPress code that redirects someone to the last post type created on the site, in this case is the "case" post type: <?php /* Template Name: Redirect */ $args = ...
Sean Bagheri's user avatar
0 votes
0 answers
34 views

fehler beim laden des blocks: ungültige(r) parameter: attributes - Gutenberg

I'm using the Gutenberg Block "Custom Post Type" It worked well for a long time. Now, as soon as I select it and want to select a blogpost, thats already created, that I wanna display here, ...
Max's user avatar
  • 1
0 votes
0 answers
19 views

REST API callback function is not called

I have a very simple function which used to work perfectly fine. Somehow the callback function is not called anymore: add_action('rest_api_init', 'create_api_posts_meta_field'); function ...
Fewture's user avatar
  • 13
-1 votes
1 answer
30 views

button onclick with get_post_permalink

I developed a custom post type. On my archive page for each post there is a <button>. The problem is that I can't put the link to the post in question. My button is in my loop. <button type=&...
Thica's user avatar
  • 15
0 votes
1 answer
153 views

Can't expose custom field to REST API

As far as I can tell, the following code should make the video custom field of my CPT project available through REST API. Yet the custom field is still not exposed. Why not? add_action('rest_api_init',...
drake035's user avatar
  • 1,125
0 votes
3 answers
39 views

Custom Post Types, Single Posts returning 404 Errors - flushing permalinks does not correct

I have a website that, using ACF Pro, I have created several Custom Post Types (CPTs) for. All using ACF Pro. Of them, 6 of the CPTs are showing fine with the archive and single templates. They are: ...
Mitch S's user avatar
  • 27
1 vote
0 answers
18 views

Keep the expansible tree (list of posts) open in the sidebar

I have created a plugin to diplay a list of posts (cpt) in a tree on the sidebar. It adds an icon [+] when posts have children. However when I click on a post the tree colapses. How can I keep the ...
Artus's user avatar
  • 92
0 votes
0 answers
10 views

How to create download page with countdown in wordpress?

I'm working on a WordPress project and aiming to create a download page similar to "APK Material Download" with a countdown timer before users can access the download link. I've explored ...
Inam Ur Rehman's user avatar
0 votes
1 answer
18 views

Tag template for Custom Post Types

I have setup a Custom Post Type called 'Sports Clubs'. These use tags. I need a page to display a list of posts associated with the various tags. I'm currently doing this for standard posts via the ...
Gareth Roberts's user avatar
0 votes
0 answers
13 views

Normal Posts and Custom Posts with Date Query

I have a custom post type with a date query and these posts only shows on the post archive list when I create a normal non custom post and save this normal post then both the custom post and normal ...
Angel Hess's user avatar
0 votes
1 answer
66 views

getEntityRecords/useEntityRecords: How to use CPT metadata?

I use getEntityRecords as described in the official data API tutorial (https://learn.wordpress.org/lesson/retrieving-wordpress-data-records/). I.e.: const [searchTerm, setSearchTerm] = useState( ''...
gresch's user avatar
  • 111
0 votes
0 answers
12 views

Display posts from Custom Post Type, group by term, arrange term groups and arrange items within groups by menu order

I have a Custom Post Type 'my_cpt' and a custom taxonomy 'types' which has several terms, all of which have posts. I want to do is be able to control both the order of the groups (terms from my custom ...
Tom Latham's user avatar
1 vote
0 answers
102 views

Wordpress Custom Post Type Archive, filter by category and get pagination working

I have created 9 different Custom Post Types via ACF and an assortment of custom field blocks for 8 of them. Those 8 are used to create different content, based on requirements for each post type. The ...
Mitch S's user avatar
  • 27
0 votes
1 answer
19 views

Frontpage overriding my posts

Each time i make a new post I cant see it ok my website when I view it. The front page (which is blank) seems to override my posts. How do I remove it or change the settings
Dineato's user avatar
0 votes
1 answer
53 views

Listing Child categories under another child category

I have a custom post type called "alz-products" under this i also have a taxonomy called "products-category" The arranged category structure to manage products as follows Spill ...
user1419170's user avatar
0 votes
1 answer
47 views

How to make 2 (or more) custom post type post pages sit under the same slug?

I've created 2 custom post types like so: register_post_type( 'resources', theme_build_post_args( // $slug, $singular, $plural 'resources', 'Resource', 'Resources', ...
Freddy's user avatar
  • 147
0 votes
1 answer
189 views

Advanced Custom Fields Custom Post Types Heirarchy

I am seeking some help with Custom Post Types using Advanced Custom Fields Pro. I have created a Custom Post Type (headphones) and enabled "Hierarchical" as explained here: https://www....
Bec's user avatar
  • 3
0 votes
0 answers
25 views

How to fetch WordPress Gallery Images to a Custom Post Type?

I am using the WordPress Email Contact Form plugin to create a custom contact form. I want to be able to fetch images from the WordPress gallery and display them in the contact form. I have tried ...
Muhammad Usman Qureshi's user avatar
0 votes
0 answers
12 views

Category display using conditions

I have a custom post type(events) created and has taxonomy(event-categories) with parent and child categories. Since im not good in coding, i will try to understand all the help from here. So what im ...
Bordzee's user avatar
0 votes
0 answers
17 views

how to properly format custom post type rewrite to get specific URL structure for archive and post views

The goal I created a custom post type for events listing and want to achieve the following URL structures all archives url This url returns 404 error https://example.com/events-list/ single archive ...
Nadal's user avatar
  • 89
0 votes
1 answer
44 views

Wordpress custom post type -> query and sort by custom field with multiple values, then published date

I have a custom post type with 2 custom fields that I am trying to sort by: The first custom field is "featured post" (yes or no values). The second custom field is "CPT images ...
Mitch S's user avatar
  • 27
0 votes
0 answers
9 views

A theme has 3 default types posts, services and portfolio in its posts grid.I want to add my custom post type products How can I achieve that?

Here it display the dropdown list of options to be displayed in asri post grid. I have made my custom_post_type Our products which I want to be listed here.
Deepika Jain's user avatar
0 votes
1 answer
26 views

Create side bar widget showing list of years as hyperlinks for a custom post type

I have a WP site using Elementor Pro. I have created a Custom Post Type called "Meeting" I have created an archive page for "Meetings" using a Loop Grid To display the post ...
Jasperjon's user avatar
  • 101
0 votes
0 answers
12 views

How to display posts from home page in blogs in category wise

actually i am converting html to wordpress and i have posts on home i want to display them on blog page in category wise rightnow my blog page in working on index.php, I have made some post dynamic ...
Mujtaba's user avatar
0 votes
0 answers
14 views

Separate archive template to show posts and CPT by same category/taxonomy

I have archives for posts and another for reviews which are working fine, try as I might though I'm struggling to have a separate archive under the URL /content/[category] that pulls both posts and ...
james's user avatar
  • 1
0 votes
0 answers
18 views

Create an archive page by combining two post type

I wanna create an archive page for both normal posts and a custom post type(gallery). I created an index.php file and put my code in there but its pagination ain't work correctly. all pages look the ...
Poorya Ghorbani's user avatar
1 vote
0 answers
22 views

How to Filter the Custom term loop based on dropdown

I had created on Custom Post Type 'resource', which has 4 taxonomies ('type', 'sector', 'industry', 'rtag') now i had added 45 posts in following manners Type - Brochure, Infographic, Research Paper, ...
Bhargav Joshi's user avatar
0 votes
1 answer
26 views

How to have a hierarchy of custom post types and use two of them in the permalink?

General Setup I'm working on a setup to create a documentary/wiki site for a company. The site should have three different levels of hierarchy and one type of content at the lower end: level 1: area (...
Stephan's user avatar
0 votes
0 answers
13 views

How to show metabox in custom php menu page

I've created a custom dashboard for wordpress and I want to show some custom metabox on it. Is there any way to achive this with a filter or function of wordpress? I've tried using the do_meta_boxes() ...
ICTDEV's user avatar
  • 113
0 votes
0 answers
20 views

Add submenu page to a custom menu page

For a company project I'm fully customizing the wordpress wp-admin dashboard to be the front end after an user is logged in. I need to hide the admin bar for non admin users and add a submenù to a ...
ICTDEV's user avatar
  • 113

1
2 3 4 5
206