Articles of custom post types

Adding class to featured image

I have specified a loop to show featured images for my custom post type and wish to add a img-responsive class from bootstrap to my featured image. How can I do this? Thanks! Code: <div class=”home-featured-img”> <?php if ( has_post_thumbnail() ) { // check if the post has a Post Thumbnail assigned to it. the_post_thumbnail(); […]

Arduous WordPress Custom Post Type Permalink Path

once again folks, i have to ask about custom post type url, because is not clear for me what to do so let me short eplain whats the problem is with it Note: I have seen a lot of solutions (here) to reach the same goal, and that’s confuses me as i’m a wordpress/php novice. […]

WordPress giving a 404 page when passing a year argument different than the current year

On this page you will see I’m listing events that fall in certain months: This is on WordPress, When you select a certain month and year it appends the URL with two arguments (month and year i.e. ?month=October&year=2014). The problem is if the year is anything other than the current year (2014), it gives […]

Edit Permalink Structure For Custom Post Type or Modify .htaccess?

I’ve been trying to find a solution for days now and I am absolutely stumped. I am putting together a website to list my domain portfolio for sale and I’m using a plugin I purchased to lists the domains. The author of the plugin is nowhere to be found and I only have a basic […]

How to create custom post type like Page

I want to create a Custom Post Type like Post or Page, It should have Page templates Option. This is for multilingual site. Any comments on this ?

add_meta_box Callback not being called

I created my first plugin last week that makes a custom post type. As this worked, I copy pasted the code I already had and modified it to be a different post type. For whatever reason however, the callback I have set for add_meta_box is not being called. Can anyone tell me why this is, […]

Get all metadata for a given custom post type

I’m using a plugin that allows me to add people profiles as a custom post type, with several custom fields used for specific information. These posts are then output via shortcode on the relevant page, with the plugin taking care of outputting the relevant data. Additionally Ive created a new page template for the page […]

insert image with custom post type

When processing the form i want the values to be inserted into the custom post type products. Here is what i have done so far $art_title = $_POST[‘art_title’]; $i = 0; foreach($art_title as $value) { $art_title = $_POST[‘art_title’][$i]; $art_width = $_POST[‘art_width’][$i]; $art_height = $_POST[‘art_height’][$i]; $art_price = $_POST[‘art_price’][$i]; $art_creation_date = $_POST[‘art_creation_date’][$i]; // Add the content of […]

admin_head-post.php only works after publish / update

I have made a custom post type with some admin back-end. Currently I am calling scripts using the hook admin_head-post.php but this only seems to fire once a custom-post type has been created (on publish) or updated. What is a better hook that runs on a specific admin page but when a new post is […]

Different structure/content for posts from a custom post type

I’ve a CPT: Services and created two posts underneath it. Now, both those posts have some static content which is different in structure and design from each other. How do I place that content in my single-services.php so that it gets showed up for the appropriate posts? I have a vague idea of putting the […]