Questions tagged [custom-post-types]
Custom Post Types extend WordPress to support additional content.
10,349
questions
0
votes
1
answer
988
views
Using wp_localize_script to get data from cpt and pass it to maplace-js locations
I'm currently building an Dealerlocator with ACF and CPT.
For the dealerlocator to shop the dealers on the map I want to use MAPlace-JS. This works fine when adding an array to the locations variable ...
0
votes
1
answer
37
views
Getting Un Wanted Gallery Shortcode In The Page on Loop
I have a custom Post Type and I am running a regular WordPress loop in single-move.php page to display the textual content of the page only. now while the post has an image gallery I am getting the ...
0
votes
2
answers
75
views
Custon Content within WordPress Loop
I have created a WP loop to display Services from 'Services' Custom Post Type:
Here is the code:
<?php
$services_loop = new WP_Query( array( 'post_type' => 'service', 'posts_per_page' =&...
0
votes
2
answers
674
views
Custom Post type & Taxonomy 404
I've created a custom post type & taxonomy, however when I go to my taxonomy page it throws a 404 error and I can't understand why.
// Register Custom Post Type
function portfolio_post_type() {
...
0
votes
1
answer
53
views
Trying to Create a PHP Variable for post_type that can be referenced Site Wide
I have several sites with several custom PHP widget loops I've created. I would like to reuse these widgets in other areas and site, but with different custom post types.
The only unique thing in ...
0
votes
1
answer
625
views
WordPress search and date filter not working with custom post type
I have a custom post type registered in my WordPress. Everything is working fine except Search and Filter functions are not working in admin. For example, I have posts from 2013 but when I select 2013 ...
0
votes
2
answers
3k
views
Custom Rewrite Rule for Custom Post Type with URL Param
I am trying to create a custom rewrite rule for a custom post type where
This:
http://test.loc/products/directory/?c=some-value
Should become this:
http://test.loc/products/directory/some-value
...
0
votes
1
answer
39
views
Add first letter of titles to array, then compare arrays
I have a custom post called foundation_firms, from which I'd like to create an array of letters, each letter representing that there exists a post starting with that letter.
I've been trying to use ...
0
votes
2
answers
61
views
Custom Taxonomy Category link
I seem to go round and round in circles here, I think lack of vocabulary or not knowing what I'm searching for is causing me my problems.
I have a custom post type projects and have a taxonomy to ...
0
votes
1
answer
181
views
Displaying a Custom post type per day
I wanted to add a random post type to be displayed on my index.php page so that it displays a random custom post type per day. However when I implemented the code it didn't show up anything. Any ...
0
votes
1
answer
794
views
Adding something to the_content
I want to add some content to every page of a custom content type. The content type is the “encyclopedia” add-on for wordpress.
At the bottom of every page I want to add the References.
These are ...
0
votes
1
answer
869
views
HowTo: Custom Post Type (Meta) to Custom Table
In looking through the code for Pippin Williamson's Easy Digital
Downloads, I notice that he uses custom tables AND custom post types.
I also see (roughly) the same Tables/Custom Post Types config in ...
0
votes
1
answer
3k
views
Custom Field not saving in Wordpress
before I start, I am not using any plugins for my CPT and Custom Fields. I do not want to make use of such plugins.
I am using several Custom Post Types and also include Custom Fields within the ...
0
votes
1
answer
2k
views
Bootstrap accordion looping through posts incorrectly
I have this page on my website - https://visitwinona.com/ask-a-local/
Where I'm calling all the categories of my custom post type faqs, I've implemented the bootstrap accordion, and it works but as I ...
0
votes
1
answer
42
views
I'm having trouble getting the permalink sample on my custom post type edit page to work
I have set up two custom post types (show & podcast) and I have parented podcast to show by following this awesome tutorial: https://1fix.io/blog/2016/02/05/parent-from-another-cpt/
The rewrite ...
0
votes
1
answer
55
views
how to set a WP Plugin's url
I am taking my first steps with developing on WP and so far I have been successfully able to play around with a custom widget that prints all necessary html to load a calendar with fullcalendar.js. So ...
0
votes
1
answer
4k
views
Custom post type sorting: alphabetical order
I want to display my custom post type "portfolio" in alphabetical order and I got it working fine with this code:
add_filter("posts_orderby", "my_orderby_filter", 10, 2);
function my_orderby_filter($...
0
votes
1
answer
4k
views
Getting 400 Bad Request on AJAX Call
I'm building a custom post type plugin using a class. I've got a form on a page which makes an AJAX call, and this returns a 400 Bad Request and a 0 response.
I've tried making the call independently ...
0
votes
1
answer
91
views
Is it a good idea to add a column to the posts table?
I'm making a custom theme for a client who has need of two custom post types. I'd like to join them together (it's a one-on-many connection) and thus was thinking of adding a column to the posts table ...
0
votes
1
answer
1k
views
Remove Quick edit for custom post type?
I have found this thread about the same thing:
Remove quick edit for custom post type
But I only managed to remove the Bulk edit option with this.
What I want to do is to hide/remove Quick edit from ...
0
votes
2
answers
3k
views
Hide custom post type from search based on custom taxonomy
I'm looking to hide from search a few custom post type posts. I'm thinking that if I create a custom taxonomy for the custom post type with a term "hidden" then all posts checked will be hidden. Maybe ...
0
votes
1
answer
2k
views
How to get only one category of custom post type?
I get all post successfully of CPT which are Order by meta_key value Date. Code is below
$today = date("Y/m/j");
query_posts(array(
'post_type' => 'event',
'posts_per_page' => 10,
'meta_key' =&...
0
votes
1
answer
64
views
How to hook WP initialization without modifying functions.php
We've got a few customizations to the standard WP installation, specifically a custom post type, some custom fields implemented using CMB2, and some hooks to admin menu configuration using the ...
0
votes
1
answer
57
views
Main query not querying any posts in custom taxonomy template
I have created a template for my custom taxonomy, byron_community_cat. I have named it taxonomy-byron_community_cat.php. My problem is, when using the default WordPress loop, it does not display any ...
0
votes
1
answer
52
views
Slug Confusion Between Post and Custom Post types?
So I have a custom post type "Testimonial" and it's got some...interesting...behaviors. Last night, I had that type running and had created two testimonials, one of which was titled "James Blackwood."...
0
votes
1
answer
27
views
Wordpress custom slug rewrite
I have custom post type 'gallery' with the same slug. For other functionality I user /gallery?tags=snow and this is ok. I need custom slug like /gallery-snow who point on /gallery?tags=snow
For ...
0
votes
2
answers
36
views
Which Template Page Should I Use?
I have created several custom post types (for example: FAQs, products and case studies) and registered a global custom taxonomy for use across all CPTs. In my case this taxonomy is called audiences. ...
0
votes
1
answer
2k
views
How to change path for default WordPress blog posts?
My site has a few custom post types each with their own base slugs (e.g. /workouts/, /trainers/, etc). I would like to give the default WordPress blog posts their own base slug (e.g. /blog/) without ...
0
votes
2
answers
1k
views
Custom Empty Results page for my Custom Post Type
I've been looking for the solution of this issue for a while but cannot find the correct answer.
I'm developing a custom Knowledge Base plugin for my site, as requested by my boss. The around plugins ...
0
votes
2
answers
300
views
How to find a specific post_type using its "rewrite slug"?
I've been struggling with a quite specific point.
I registered some custom post types and specified the rewrite slug for each one of them.
'rewrite' => array( 'slug' => 'my-slug' ),
...
0
votes
2
answers
2k
views
CRUD operations in wordpress
Recently volunteered (for a friend) to make a website for his business with same added features. I do have moderate web-dev experience but really wanted to try to use wordpress for this. Here are some ...
0
votes
1
answer
37
views
How to get a custom type post data when it has a connection with another custom type post?
I have two custom post types: Country and City.
Country
There is just a text field to fill with its name.
City
I have a text field for city's name and also a select with all the countries that was ...
0
votes
2
answers
109
views
How do I create an overview page with custom calculations from a post-type?
I've created some custom post-types using the Pods framework, however the the solution to my question should be the same regardless of pods. My custom types are event, team, achievement, ...
0
votes
1
answer
264
views
wp_insert_post wrong post type [closed]
Much like this question, I'm having trouble with wp_insert_post causing recursive post adding. I do, however, have implemented a page type check - the problem is the inserted post always gets added as ...
0
votes
1
answer
684
views
disable quickedit for specific custom post type user role
I seem to be missing something fundamental somehow ('ll try and keep it short but can provide more code if needs be of course )
I have registered a CPT with following arguments
'capability_type' =&...
0
votes
1
answer
68
views
custom post type template
I am following the wp doc for adding a custom post type:
function create_post_type() {
register_post_type( 'startup',
array(
'labels' => array(
'name' => __( 'Startup' ),
...
0
votes
1
answer
990
views
Wordpress Picks Up Wrong Template for Custom Post Type Archive Page
I have registered the two following custom post types:
function dogs() {
$labels = array(
'name' => 'Dogs'
);
$args = array(
'labels' => $labels,
'public'...
0
votes
2
answers
45
views
Replace dynamically content in a custom database table when a custom post is created
I use a third party plugin that saves events locations addresses as a custom locations post type in a separate table - wp_em_locations.
Because events are created by multiple authors, they write ...
0
votes
1
answer
2k
views
How to hyperlink content from archive page with custom post-type
I created a custom post type to show my products. The taxonomy name is called field.
My products page (products.php) is customized as the following:
<div id="products_wrapper">
<?php
...
0
votes
1
answer
407
views
Add post meta programmatically to attachment
I have a function to create a meta key for my custom post types. It works pretty well for them but now I want to use the same function for the attachment post type.
Normally it should work with the ...
0
votes
2
answers
2k
views
Loop increase number
$args = array(
'post_type' => 'events',
'order' => 'ASC',
);
$wp_query = new WP_Query($args);
?>
<script type="application/ld+json">
{
"@context":"http://schema.org",
"@...
0
votes
2
answers
77
views
custom post for slider
I am trying to create custom slider so trying to print all ul in same li . but problem is that I am getting data in different different ul.
Here is query.
<?php
$args = array(
'...
0
votes
2
answers
3k
views
Custom post type showing same Post on all Pages
Have a custom post type, where each post is a gallery, and each has an Advanced Custom Fields Gallery field that has say 5-20 images each. Also have a custom post type post template as seen below (...
0
votes
2
answers
582
views
WP Query 'posts_per_page'
I've a custom post type Clinics and Doctors. Each clinic has own clinic_id (through custom fields). Each doctor has the same field clinic_id with numbers of clinics where he works.
I need on single-...
0
votes
1
answer
7k
views
How to display custom post type tags?
I have created custom post type with 'members'
<?php
$member = new CPT(array(
'post_type_name' => 'members',
'singular' => __('Members', 'c2s'),
'plural' => __('Members', '...
0
votes
2
answers
268
views
Featured image size in column
I have a featured image preview in column view in my Custom Post Types. Now I want to change the size of it. This is my code:
add_filter('manage_posts_columns', 'add_img_column');
add_filter('...
0
votes
2
answers
154
views
Associate page w/ specific single post template?
I'm working on a site that uses two different pages to filter lists of posts associated with the same custom post type ("media"), and both pages have their own templates-- a more general page named ...
0
votes
1
answer
208
views
WordPress Custom Post Type - show only certain posts that have specific taxonomy set
I am looking to show specific dishes that belong to specific menu.
I've created a "dishes" custom post.
I've created a custom "menu" taxonomy, with 3 types of menus ('premium', 'children', 'concept')
...
0
votes
2
answers
97
views
Multiple pages per post (not pagination)
I'm making a movie database and need to have multiple pages per post: details, cast, recommendations, reviews (something like IMDb). I would prefer to not use any plugins if possible. I'm not new to ...
0
votes
1
answer
6k
views
Submitting Custom Post Types with custom fields from Front-end form
I'm trying to have a custom type post with 2 custom fields. Now I have the working custom post types and working form at the front-end via a template page. The problem is I can not get the custom ...