The tag has no usage guidance.

learn more… | top users | synonyms

0
votes
2answers
29 views

How do I add a category to my post_type

I have a section in my dashboard called "services". I have 4 services I have 2 categories for these services: residential and commercial 2 of the 4 services have the category "residential", and the ...
0
votes
0answers
17 views

Use custom post_type from a different database

I want to display posts from one site on to a second site. I have succesfully done this: <?php $wpdb = new wpdb( '$DBname', '$Password', '$DBuser', 'localhost' ); ...
1
vote
1answer
15 views

Should I be using custom post types for this or terms and taxonomies?

So for the past week or so, I've been developing a plugin that lets users manage a restaurant menu. I've learned a lot about the process of making plugins as far as adding custom post types, creating ...
0
votes
0answers
25 views

Custom post type, category slug and fake page for category base

I'm list all category links with all post_type on the fake page (cloud). to my site I am using a few custom post_type Simple Post type slug: Shop Simple Category base: Cloud My Permalink settings ...
-2
votes
3answers
74 views

How to get only post='product'

I am using this code to search products from a wordpress/woocommerce website. My requirment is URL will be like "http://localhost/wp/?s=D34&post_type=product" While s=D34 is search string. When ...
0
votes
1answer
19 views

Custom post type in theme not appearing

I have a theme on WordPress 4.4 which has this file included in functions.php: <?php function post_types(){ $labels = array( 'name' => __( 'Newsletters'), ...
0
votes
2answers
45 views

How do I implement custom fields without using any plugins?

I am trying to create a member directory and using a custom post type members. I am familiar on how to use the ACF plugin but is there any methods on how to associate a custom field for a specific ...
0
votes
1answer
30 views

Registered Post Type Isn't Showing in Admin Menu

I have a custom function to make posts hierarchical by registering a post type in my functions.php like this: register_post_type( 'post', array( 'hierarchical' => true ) ); After uploading, ...
1
vote
1answer
57 views

get_post_type() in in_array doesn't work for some reason

I am trying to create some function for metaboxes and some reason i can't get get_post_type to work in in_array. Everything else seems to work in testing but in_array nope. This is the function that ...
0
votes
2answers
35 views

Can I change my post type to anything and my site still work?

I'm working on an application using WP as my CMS. I was successfully creating new posts and working with them in my app. But I noticed when visitors went to the website they were being listed in the ...
0
votes
0answers
36 views

select metabox not saving selection

The code below reside in my plugin.php file, the select box populates fine from the options text area but does not save the chosen value. do not understand why. <p> <?php ...
0
votes
1answer
39 views

WP_Query | 'post_type' doesn't work

I'm new to WP theme development and I've an issue. I've created a custom post type 'portfolio' via CPT UI plug-in. Now I want to create a custom query to show all the posts with the post_type = ...
0
votes
0answers
22 views

How to remove custom post type identifier in permalinks? [duplicate]

I've purchased a premium "SEO-fitted" (so I thought) theme, that uses custom post types in the URL. like /cat/ or /item/ But I really need to remove those slugs, and change my URLs so it will be less ...
0
votes
1answer
52 views

How to copy a custom field from the user's CPT to the user's normal posts

Each author has a single post in a CPT. In their CPT post they have a custom field. Each author can also post to a normal post type as much as they like. How can I copy the custom field of the ...
1
vote
2answers
174 views

Get All IDs Of A Post Type Using WP_Query

I am trying to get a list of a custom post type's IDs using WP_Query, but it is returning undesired result, which is a memory leak and stuck browser. Here is the code I use: $the_query = new ...
0
votes
0answers
47 views

do action inside a class is not working

I am trying to create my custom hook and call it from within a metabox class. Here is the pattern: metabox.php -- <?php require("libs.php"); require("test.php"); class metabox() { function ...
0
votes
0answers
18 views

Agent post-type

I try to make custom post-type for my theme which I can add information about agents. Which I found of post-types all are just like ordinary post sharing with title-content-comments... But what I need ...
0
votes
1answer
38 views

Show post type taxonomy

I'm making a WordPress theme I've copied post-type codes from "AVENUE" theme by "FabThemes". Codes Are these: <?php /* Property Listings*/ function post_type_listings() { register_post_type( ...
1
vote
2answers
21 views

How to retrieve a custom post's capability?

When you register a custom post type, you can specify it's capability: 'capability_type' => 'page', Is there away to retrieve the capability_type within a page (based on the post object ...
0
votes
0answers
25 views

How can i add radio fields to my custom post ? Nothing works

I have 2 files in my plugin for this, one makes the custom post type and its meta box and the fields for the meta box. The 2nd file prints out the meta box, its basically the layout. I am able to ...
0
votes
0answers
119 views

Create custom post type just like a page post_type

Here's what I'm trying to achieve: A custom post type with the attributes/properties of a page post_type I'm aware of the supports array which allows page attributes to be used, but this isn't what ...
0
votes
0answers
179 views

Updated from 3.8 to 4.2 and all post types changed to “post”

My client updated his website from WordPress 3.8.x to 4.2.1 in order to make a plugin verify as working correctly. We were holding off originally to do it and some other plugins all at once so we ...
0
votes
0answers
15 views

WP Custom Post Type permalinks with category [duplicate]

I am trying to accomplish the following: Website will contain a section titled "resources". I would like to separate the content using content post types. Post Type: Resources ( This i can create via ...
0
votes
1answer
13 views

Issue attempting a wp_query_posts with tags

Having an issue trying to query the most recent posts using the tag, in this case, trending. I used the following code but I get no results. If I switch out 'tag' to 'post_type' it will work: ...
0
votes
1answer
30 views

Pulling in Related Posts based on Post Type array

I'm trying to create a Related Posts section on my single.php file and I'm using this as a starting point (http://www.wpbeginner.com/wp-tutorials/how-to-display-related-posts-in-wordpress/) and my ...
0
votes
1answer
313 views

Check If post id exist in custom post type , outside of loop

How can I search in database if id exist in a post type?. I want to search $id=123 in post type 'movies' like this, is this the correct way to do it? $content = ...
0
votes
0answers
31 views

Search for words in post_type

I have a page-doctors.php with the list of doctors, these doctors are registered as post_types, the code that taking all post_type doctors is: $paged = ( get_query_var('paged') ) ? ...
0
votes
1answer
427 views

get_post_types not working properly in admin

I'm trying to get all post types (custom & built_in) but it's only gives me only built_in ones in admin. I can get all of them in root (5 with builtins included) but in admin, i can only get 3. I ...
0
votes
1answer
131 views

Disable default posts (Posts,Pages,Comments and Media) in wp-admin

I want to disable the default post types for user author in the wp-admin panel of the wordpress and display only custom post types. For that i had got the code given below. function remove_menus(){ ...
1
vote
0answers
205 views

Default 'post' post type archive slug?

I have a wordpress site, which has a front-page.php rendering a custom front page, so that this template will show no matter if WP admin settings is set to static page or show posts. The default ...
0
votes
1answer
193 views

post_parent in custom post type

I've two custom post types, type1 and type2 My current workflow of creating contents, from the user perspective a user created posts of type1, i.e. post1, post2, post3 on a particular day our ...
0
votes
0answers
225 views

Custom post type and shared custom taxonomy ..permalink structure

hope someone can help me since I'm fighting with this issue since weeks without a solution. Scenario: ~ 15 different post types (hotel, bed-and-breakfast, etc) -> reason to use the post_type ...
0
votes
0answers
21 views

Prevent from duplicating post/pages

I want to import posts and pages but not to duplicate them. $post_types = array('post', 'page', 'wck-meta-box'); foreach ($post_types as $post_type ) { foreach ($posts[$post_type] as $post ) { ...
0
votes
0answers
19 views

Custom post types accessible from 3 urls

I have created a custom post type named library and it has a post named irrlicht.when you visit example.com/irrlicht or example.com/library/irrlicht or example.com/libraries/irrlicht you still access ...
0
votes
0answers
61 views

Some questions regarding post-types and pagination

I've built my own theme from scratch using the HTML5 Blank Framework My problems started when I added 3 differen post-types; Work, 50mm and Findings. I've hided the standard 'Posts' type, so that I ...
0
votes
1answer
239 views

Custom Post Type causes Page Not Found

I found a basic tutorial online which gave the rundown on how to create a plugin from scratch and sets up a new custom post type. I could not find any basic coupon plugins that accomplished what I ...
0
votes
1answer
36 views

Taxonomy template by post type

I have 2 custom post types that share a taxonomy. The taxonomy template of my taxonomy ( taxonomy-my_tax.php ) will query both custom post types. Is there a way to have a taxonomy template for each ...
0
votes
1answer
98 views

How to define which register_post_status goes to which register_post_type?

New to registering post types but looking at samples, and the codex not helpful here. I am not understanding how the two of these relate? This is just bare bones so someone can explain (the parameter ...
0
votes
1answer
65 views

How to Set Taxonomy Object Description?

I noticed when dealing with Post Type Objects (Using get_post_type_object();) and Taxonomy Objects (Using get_taxonomy();) there's a property called "description". How do you set this description ...
4
votes
2answers
145 views

How do I create a link that will always show the latest post?

If I want to create a link that will always show the latest post how can i do that? Lets say I have three post types and there are three links with posts names (like a nav list) to those post types. ...
2
votes
1answer
265 views

Adding a term name from a custom taxonomy assigned to a post link displayed by a wp_query loop based on another taxonomy

I have registered a custom post type "Animals" and also two custom taxonomies ("Vertebrate" and "Type") assigned to it, which have their own specific terms, for "Vertebrate" it will be "Mammals" and ...
0
votes
1answer
657 views

Sort Posts By Custom Field Date?

I have the following code displaying posts from a custom post type. However, I need them displayed in date order from information put in a custom field, can this be done? I try this code :- $course ...
0
votes
1answer
32 views

Post types translation

I try to translate post types names (Post, Page and Attachment). I have the following code: function create_skip_post_types_box () { $post_types = get_post_types(array('public'=>true), ...
3
votes
2answers
224 views

Better to use a post type archive, page template, or shortcode for generating a highly configurable CPT archive?

I am building a theme in which I have a post type, which will have an archive in a grid layout. You're probably thinking, "Just use the CPT archive!" Well, there are some cons to that method that I'd ...
0
votes
2answers
118 views

Show only public custom posts in home page

I am working on custom post types. Presently we are using below code to display all custom posts in home page <?php $args = array( 'public' => true, '_builtin' => false ); ...
3
votes
1answer
532 views

How do i know the current post type when on post.php in admin?

Im trying to do something with an admin_init hook if - and only if - the user is editing a post (post.php) with post type "event". My problem is that, even though wordpress points to a global variable ...
0
votes
1answer
75 views

wp_dropdown_pages() returns empty string for post type anything other then page

wp_dropdown_pages() while using for any post type other then page returns empty string. Codex says post type can be passed as key also the function uses get_pages() which takes the post_type key. So, ...
0
votes
1answer
77 views

Post type no single page

I have created a post type and I am trying to create a single page for that post type, I am creating a php file called single-job.php and it is using the index.php as a template. Below is my function ...
0
votes
3answers
557 views

Replace Post-Title with variable

I want to set a custom post-title with a custom-field meta in my Wordpress Theme. The user will add a new post to the post-type. When they do they will only see the "Title", "URL", and "Publish" ...
0
votes
1answer
459 views

How to Display Child Taxonomy Posts

I am trying to show items on a page grouped by child taxonomies in something that looks like this... Child Taxonomy 1 (h2) Item 1 Item 2 Child Taxonomy 2 (h2) Item 3 Item 4 I did manage to get ...