Questions tagged [type]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
20 views

YOAST SEO won't work on custom post type archive [on hold]

I created my custom post type page (archive-objects.php). This page works fine, I have been created page for it and attributed template to it. So everything is okay. But something wrong is with YOAST ...
0
votes
0answers
14 views

WordPress Wallet/Credit without woocommerce

I am trying to create a credit/wallet like system where user can add their credits from the front-end and when they clicked (buy) a CPT, it would subtract from their total wallet balance. I've tried ...
1
vote
1answer
459 views

Custom Post Type Rewrite To Include Parent Page(s)

I have a page title "more" with subpage "cities-guide". Said "cities guide" page has a loop that pulls in posts from custom post type "thailife_city_guide". My permalink structure is /%category%/%...
0
votes
0answers
21 views

Add custom taxonomy slug to URL of Custom Post Type

I have a Custom Post Type named "blog", and a Custom Taxonomy named "area" (both setup using the CPT UI plugin). I have also used below code to add the taxonomy slug in the url, so that standard WP ...
2
votes
2answers
1k views

Display custom post types by date field

I have a custom post type that is simply titles with a date field. I want to display these posts in a list in order of this date field (not date posted). So simply: -- Sample date Event title 1 ...
1
vote
1answer
2k views

Duplicate Custom Post Type and Taxonomy Slug

I've seen a few questions that are very similar, but I haven't been able to get an exact answer, so I'm going to explain my situation here. Quite simply, I need the following url structure: site.com/...
0
votes
1answer
33 views

CPT archive redirects to single post

Ok, the title does not help too much, so let me try and explain. It's a Genesis-based website. I created a CPT: function cptui_register_my_cpts_livestreams() { /** * Post Type: live streams. */ ...
0
votes
0answers
25 views

When clicked Restore link and permanently link, the link you followed has expired is shown

I have created custom restore and permanently link in the custom column of the custom post type. I have created the restore and permanently delete using the following codes. // Actions to delete. ...
3
votes
3answers
3k views

How to force one column layout on custom post type edit page?

I've created a plugin using custom post types and I need to force the default two column post page to a single column. At the same time, the Publish metabox must move to the bottom. I need to do this ...
-1
votes
1answer
266 views

custom post type single page template not working

I created a page portfolio and select template Portfolio Template My portfolio page does not access the template-portfolio.php file. In which also includes content-portfolio.php in template parts ...
0
votes
0answers
14 views

How do i get post content after the click of the each sub tab of the parent tab?

I'm working on the custom template in this page I have added the JQery Tab in the, now how do I get content of each sub tab after click on it? I have created Custom Post Type in the admin panel ...
0
votes
0answers
27 views

Post relationships/nesting

Ok, I know that posts can't be nested but for the purpose of this question, I'm using the word. I'm having some trouble wrapping my head around creating a pedigree site, I'll explain where I am and ...
1
vote
1answer
454 views

Enable Comments Box On Custom Post Type

The wordpress theme I'm using doesn't support comments on one of its custom post types (Shows) and I've been trying to enable them. I added the code below to single-shows.php (copied from shows.php) ...
2
votes
1answer
55 views

Type hinting and void return question

Say I have a class that registers a custom post type like class Test { /** * The custom post type slug * * @var string * * @since 1.0.0 */ const POST_TYPE_SLUG = 'test'; /** ...
0
votes
0answers
25 views

Manual Scheduler For Custom Post Type

I have a custom post type with a completely different interface (basically, I've removed all wordpress metaboxes and added my own). I am trying to build a schedule metabox for this custom post type (...
0
votes
0answers
35 views

Custom Post Type Rewrite URL

So I followed a guide on another post here to add a taxonomy to the post type URL which works BUT it breaks the url's for the pages. My permalink structure is %postname% and my code is as follows: ...
0
votes
2answers
2k views

wp_query 's' parameter does not work with custom post type

I have a custom post type 'property'. I am trying to make a search for it, but it does not work with wp_query parameter 's'. $wp_query = Wp_Query(['post_type' => 'property', 's' => 'test']); ...
0
votes
1answer
60 views

Custom Post Types and Broken Permalinks

The permalinks on my website breaks frequently. I found out that it's being caused by a plugin I created. The plugin basically creates a custom post type with custom fields and stores in the wp-...
0
votes
1answer
165 views

How to allow .bin files upload?

How can I allow .bin files upload in media library? I have found couple codes online but none of them actually work.
0
votes
1answer
46 views

register_post_type permalink

Next, I have a problem. I created a post_type = 'gallery'. So when I open my gallery my link goes like this: localhost/gallery_name/image_name but I need a structure like this: localhost/post_name/...
3
votes
0answers
327 views

Add custom field to category of custom post type

I want to add a custom field (for a icon) to categories of a custom post type. I use the default category type and not a own create category taxonomy. How can I add the custom field only to the ...
3
votes
2answers
13k views

Attach pdf file to custom post type

I am trying to attach a pdf file to a custom post type. I have found this snippet at wpsnipp.com. The code does the trick, but only for posts. I have a custom post type named 'events' and I can't ...
0
votes
1answer
219 views

Customizing URL slugs of Custom Post Type and Taxonomy make posts/pages 404

This problem has been for bugging me for days and I feel that I am close! Creating a review website, I have custom post type called review, organized in a custom hierarchical taxonomy niche. Put ...
0
votes
1answer
246 views

Add post tags to previously created custom post type

I am trying to add post tags to the custom post types bbpress creates, so that I can do some "related topics" kind of stuff. Is there a function that adds a post support like 'taxonomies' => ...
0
votes
1answer
934 views

Custom post type single (permalink) throws a 404 error

I'm working on a website that has Woocommerce installed (also a CPT if I'm right, but that one works fine). This website has a custom post type for jobs, this cpt has posts that are linked to in the ...
1
vote
1answer
36 views

Need a help on sanitization

I have a theme on review, and I do add section 'type'=> 'select' on few occasions like this. $wp_customize->add_setting( 'personal_lite_post_link', array( 'default' => 'enable', ...
1
vote
0answers
73 views

Turn On Comments On Custom Post Types in Directory Theme

I have been trying like crazy to get comments turned on in a directory theme with Custom post types. Their support wont do much of anything but link me here and I've tried what I've found, but its ...
-1
votes
1answer
47 views

Display post structure in function

I have custom post type : edge, so I built some content by Visual composer. Now I need to display all post type edge in my page. I use the following code in function to get posts but I can not keep ...
1
vote
0answers
29 views

ERROR: Your feed is invalid (after update WP4.7) in custom types

i have created a new custom type “companias” with pods framework plugin , this custom type have this own website with its feed news, and other custom post types i have created. For example “fercam” ...
1
vote
2answers
790 views

pre_get_posts filter using numeric meta_query comparison (from dates)

I have an expiry date ACF field 'post_end_date' which has been applied to multiple post types, including 'post'. I'm trying to filter out any posts, across the entire site, where today's date is ...
0
votes
1answer
34 views

How to use Categories of custom post type

On my website psychscenehub.com I have Custom Post Type setup. Just Like the WordPress default Post section, I can see the categories on Custom Posts, but I don't know how to use them to display on my ...
2
votes
3answers
3k views

Using single.php from plugin folder instead of default template folder

I am trying to figure out how to use another single.php for a custom plugin I'm making. It's for a custom post type. Because if people install this plugin, they won't have the custom single-product....
-2
votes
1answer
115 views

Default post type doesn't display in url

My site currently has an opinions page which displays opinions posts (/opinions/). The post pages are only showing as /post-title/ when I need /opinions/post-title/. Code below, changes the default ...
0
votes
1answer
41 views

single- and archive- templates not being applied to custom post types, not even after flushing permalinks

As stated in the title, I'm unable to get the archive or single pages of my custom post type to use the correct templates for them. Funny thing is, they worked just fine on my virtual server (WAMP), ...
1
vote
2answers
2k views

Archive Page for Custom Post Type is not Working

I have registered a custom post type "tutorials" with the following snippet. <?php /* Template Name: Tutorial Archive */ get_header(); ?> <div id="content"> <div class="...
0
votes
1answer
61 views

Display one post randomly from category on home page

I have a custom post type called "Milo-Books" and a category named "Featured" with ID of "100". I want to run a query which pulls out on post from this category on the homepage, but randomly and I ...
0
votes
2answers
395 views

Custom Post Type doesn't use single.php or single-{custom_post_type}.php

I tried to set up a custom post type in Wordpress, and everything worked just fine. Until displaying a single post from my custom post type. First it didn't automatically use the single.php (as it ...
0
votes
1answer
63 views

Showing the project type in HREF

Im kinda new to PHP so bear with me. Im building a site for my uncle using the Fluxus Theme in Wordpress. He's an artist, his art is displayed in the following order: Menu Category1 --Actual Art --...
3
votes
3answers
3k views

Why does $wpdb return strings for mysql integer values?

I find it very inconvenient and hard to understand that the default behavior of the Wordpress db-interface is to convert all integer (and float?) types to strings. e.g $wp_posts = $wpdb->...
0
votes
2answers
41 views

How to retrieve custom field values and save again as array

I am new to PHP and WordPress. I have this scenario. There are 4 custom fields saved in page, named: _custField1 _custField2 _custField3 _custField4 What I need to do now is to fetch their values ...
0
votes
1answer
34 views

Meta boxes not saving

I have a custom post with two custom meta boxes that I add using this tutorial:http://wptheming.com/2010/08/custom-metabox-for-post-type/ When I update the post, it disappears. My code: function ...
3
votes
1answer
96 views

Why is the »_builtin« parameter not advised in »register_post_type()« for custom post types?

The parameter "_builtin" => true is a huge help for me, as this will set good permalink structure, like standard posts, for example: example.com/my_category/sub_category/POST-NAME instead of ...
1
vote
1answer
61 views

Permission issue with custom post type - not added to menu - by plugin

I've created a custom post type and taxonomy like this... function register_post_type_products() { $labels = array( 'name' => _x('Produkter', 'post type general name'), ...
0
votes
1answer
31 views

How to list all names and descriptions of a custom taxonomy

I have a custom taxonomy (toolkit-sections) inside a custom post type (toolkit-tools) and I'm looking to just list the taxonomy names and descriptions from toolkit-sections on a homepage. I don't ...
0
votes
1answer
244 views

How to display data in archive page?

I have a custom post type 'job'. I created a archive-job.php . How can I display 'post date', 'city', 'state' in my archive-job.php page? Currently, my archive-job.php page displays a list of jobs ...
1
vote
0answers
1k views

Remove Custom Post Type Slug and add Custom Taxonomy to Permalink Structure?

The wordpress theme I'm using uses a custom post type called 'coupon' and a custom taxonomy called 'store'. The default permalink structure for a coupon post is site.com/coupon/CouponPost I would ...
0
votes
0answers
80 views

WP Admin register taxonomy and post type performance

I noticed that the wp backend (admin) gets slower (and slower) when creating custom post types & taxonomies. (note that I'm not flushing any rewrite rules). Right now I'm calling the ...
0
votes
1answer
103 views

Custom permalink based on custom post type fields

I'm workin on new webiste and I got stuck :( Basically I've created a custom post type for products with custom fields etc. Each product has a main category and subcategory - selected from <...
0
votes
1answer
525 views

Custom taxonomy archive page problem

My website is built on custom post types, that I have organized with different custom taxonomies. The menu buttons are the taxonomies archive pages (red, blue, green), so that when you click on the ...
0
votes
1answer
7k views

How to detect if is_404() or is_page() or etc…? [closed]

is there any way, to output, like this: echo $current_type; and it gave me: is_404() or is_page() or whatever it is_blabla()