The tag has no wiki summary.

learn more… | top users | synonyms

10
votes
8answers
8k views

Adding custom post type archives to a WordPress menu

Is there a way (besides adding a Custom Link) to add a custom post type archive to a menu in WordPress? If it's added using a custom link (e.g. /cpt-archive-slug/), WordPress does not apply classes ...
5
votes
3answers
2k views

How to use a custom post type archive as front page?

I'd like to use a custom post type archive as a site's front page, so that http://the_site.com/ is a custom post type archive displayed according to my archive-{post-type}.php file. Ideally I ...
5
votes
1answer
3k views

Custom Post Type Template - Archive

I have a custom post type, called 'job', and I have the following templates in my theme: single-job.php (works fine, displays single job as expected) archives-job.php (is not recognized?) ...
5
votes
1answer
543 views

How do you create an archive for a custom post type from a plugin?

So I'm creating a plugin to create buildings that list condos for sale. The simplest way to do this was to just create a custom post type for the buildings and then the listings but I'm now stuck on ...
5
votes
1answer
2k views

Custom post type yearly/ monthly archive permalinks

I have a custom post type "news" in my Wordpress site. I am using Advanced Custom Fields plugin to add meta data to each post. I want to create an array of news items as an archive: [2013] ...
5
votes
2answers
2k views

How to set a custom post type to have viewable future posts

I've setup a CPT to act the same ways as posts but used to post event details. Thing is that some of the posts are in the future and such have a future date set on them. Problem is that normal users ...
4
votes
2answers
233 views

How to seamlessly redirect between different archive and singular slugs?

I have a CPT with slug function (singular) and archive slug functions (plural). Permalink structure for: singular is /function/[postname]/ archive is /functions/[page-x/]. (can poke live at ...
4
votes
1answer
975 views

How to filter custom post type archive by meta value

I have a problem where I'm trying to build a calendar plugin for a client. I'm having trouble getting a date based archive for the custom post type I'm using. I'm not too well versed in how the ...
4
votes
1answer
71 views

What are the advantages of using a custom post type archive?

I'm currently working on a theme that makes heavy use of custom post types to structure the content. To display a lot of the content I am using the respective archive-$posttype.php but this seems in ...
4
votes
1answer
1k views

Custom Post Type Archives by Date with Custom Permalink

I'm a bit stuck with getting the custom permalink for custom post type (CPT) archive to work. I've registered my 'press_release' CPT as following: add_action('init', 'press_release_post_type_init'); ...
4
votes
1answer
2k views

Sort Custom Post Type Archive by Taxonomy Term

What is the best method (as of 3.1 or 3.2 beta) to sort a custom post type archive by a given taxonomy term? I'm trying to make a staff page and I want to sort employees by department. So the ...
3
votes
2answers
85 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 ...
3
votes
1answer
4k views

Get monthly archives for custom post type

I know this is a rather common topic, but I can't seem to resolve the issue I'm having. Any help is greatly appreciated, I'm spinning my wheels at this point. Using Custom Post Type UI plugin, I've ...
3
votes
5answers
860 views
+50

Create a custom archive page for a custom post type in a plugin

I'm writing a plugin that creates a custom post type named "my_plugin_lesson": $args = array ( 'public' => true, 'has_archive' => true, 'rewrite' => array('slug' => 'lessons', ...
3
votes
1answer
700 views

Custom Post Type Archives with 0 Posts Redirects as 404

I'm working with the new custom post type archives in 3.1 and I noticed that when my post type has 0 posts, the archive for the type results in a 404. Looking at the order of hooks being processed, ...
2
votes
1answer
959 views

Custom Post Type / Taxonomy Slug / Post Title with post type archive

I've tried plugins, read through stack and spent hours on this, and I just can't seem to find a way to achieve what I want. I can achieve the following permalink structure: ...
2
votes
1answer
138 views

Custom Post Type archive as front page

I basically have the same problem like in this question, but the correct answer doesn't work for me. Yes, I get a list of posts from my CPT, but the archive-{post-type}.php is not used to render the ...
2
votes
2answers
4k views

Get custom post type slug for an archive page

How do I discover the custom post type slug when I'm on an archive page? For instance if /products/ fires the archive-products.php template, how (pragmatically) do I get the post type slug? Thanks
2
votes
2answers
1k views

Archives for custom post type based on a “date” meta value

I've got an "Event" custom post type. Each post has a meta field for the actual event date, which cannot be the posts's publish date, as most all the event dates will be in the future. With that, I'm ...
2
votes
2answers
1k views

Custom Post Type Archive Page not showing

I have a category on my website called 'profiles' I am in the process of moving this category to a custom post type called 'profiles'. My problem is I cannot get the archive page to show for this ...
2
votes
1answer
16 views

How to get_queried_object on multiple objects?

My Setup I have a custom post type "zap_apartments" with 2 custom taxonomies "zap_audience" & "zap_cities". I wrote some RewriteRules to access all "zap_apartments" for a "zap_audience" + ...
2
votes
2answers
230 views

Custom Post Type Archive in Sub Folder

I have a sub-directory in my Wordpress theme (there are a lot of pages and I want a more logical structure). I have a custom post type called "entry" but if I place the archive-entry.php template in ...
2
votes
2answers
1k views

Custom query variable - get wordpress to redirect to nice permalink url

I have been looking for an answer for the last couple of hours but could not find anything pointing me in the right direction. Some advice would be very much appreciated! What I already have: A ...
2
votes
2answers
637 views

How to list custom post types?

Here's what I'd like to do: a) Create a custom post type and write panel for a menu item called "My Stuff." b) "My Stuff" will behave like a category -- but the content will not appear in the main ...
2
votes
1answer
1k views

Adding Sticky functionality to Custom Post Type Archives

In WordPress, Custom Post Types do not have Sticky functionality as a core feature. It is possible, I'm sure, to create it in certain cases—and I'm working on a project that requires it for ...
2
votes
1answer
132 views

Archive template

I have several custom post types and we need to create separate archive templates for these. I tried the following advice, but it's still using the default archive template. In the form of the ...
2
votes
1answer
803 views

Display Next/Prev when looping Custom post-types archive?

I'm trying to display the Next/Prev navigation buttons on my page which displays all of the pages within my 'events' custom post-type. The issue is that the buttons are not even displaying, but I have ...
1
vote
2answers
2k views

List all posts in Custom Post Type but group dynamically by Custom Taxonomies

I have a custom post type named "Resources" which has a Taxonomy named "Types." I have it manually pulling each term which isn't the most elegant solution and every time there is a new term added, I ...
1
vote
2answers
957 views

Rewrite custom post type url's adding meta box values

I've got these custom post types (CPT) and meta boxes: Movies (CPT) Genre (Meta box) Genres (CPT) If one movie is called Die hard then I want the permalink to be: /genres/action/die-hard This ...
1
vote
2answers
229 views

Have a Custom Post Type index page display taxonomy items instead of posts

I have a CPT registered that is called lessons with a custom taxonomy (category) that is called courses. I want the /courses page (archive-courses.php?) to display the individual courses (i.e. "online ...
1
vote
2answers
194 views

Loop that displays the first post of every available custom post type?

Is it possible to create a loop that goes through all the available custom post types without statically defining what those custom post types are, and then displaying the featured image of the first ...
1
vote
1answer
889 views

Archive list for custom post type categories

I am using a recipe plugin that uses a custom post type of 'recipe'. I currently have multiple lists of recipes from each category on a page. I am trying to get the title of each category list to link ...
1
vote
1answer
1k views

I can't set meta_key in my custom post type query

I've created a custom post, events, and saved the meta data event_year to each event. I'm trying to get a year's event archive. When I go the the following URL, the meta_key and meta_value are not ...
1
vote
2answers
230 views

Make Two Views of Post Type Archive At Two URLs

Updates 6 Feb 14 to make more specific as requested in comments. I have a post type, we'll call it "Projects", with the slug "projects" for which I'd like to offer two views: list view (default) ...
1
vote
2answers
304 views

Tell wordpress to show a single page instead of an archive

So I have multiple custom parameters in the url, and at some point when the query reaches 3 parameters (e.g. ...
1
vote
1answer
610 views

How can I filter by taxonomy on a custom post type's page?

Right now I am outputting the related categories to the current displayed post type as shown below. I am using wp_list_categories to list out the categories and it works just fine. The only issue is ...
1
vote
1answer
140 views

Alphabetical sorting of custom post type - one letter per page

Basically what I am looking for is a way to sort custom post type in alphabetical order and separate each letter, so you have one letter per page. See illustration. Hopefully there is a plugin or ...
1
vote
1answer
208 views

Update Old Links To Pretty Permalinks Custom Post Type

I'm looking for a plug-in or bit of php that will go through about 300 posts that use hyperlinks in the old p format: <a href="http://mysite.com/?p=3592"> and automatically replace them with ...
1
vote
1answer
2k views

Getting taxonomy terms used by custom post type

I have a custom post type - case - for which I am building an archive page. There are three custom taxonomies for this type - micro_organisms, infection_types, and antibiotic_types. These taxonomies ...
1
vote
2answers
813 views

Show only posts from one category on custom post type archive page

I have a custom post type, called Exercises. I also have many categories within that custom post type. I use archive-exercises.php custom loop to display my main exercises page. Question: How do I ...
1
vote
1answer
1k views

Add the current menu item CSS class to a custom page type archive in Wordpress menu

I've been reading a lot about this but couldn't find a solution. Basically I'm trying to show a current menu item on a dynamic page that is created by a custom page type archive. The default menu ...
1
vote
1answer
155 views

Custom-post-type-archive: posts sorted/filtered by year?

I have a custom-post-type wr_event whose posts are sorted by meta_key "event_date". Therefore I have this handy function … function get_event_list( $latest = true, $order = 'ASC' ) { echo ...
1
vote
1answer
67 views

How should I structure my post types?

For the site I am making, I have a few post types: News, Events, Projects, Placements. Each one of these post types will need its own archive page, accessible through the navigation. I am able to ...
1
vote
2answers
239 views

Second Custom Post Type Archive

I've got an event custom post type, and using filters, I've configured the archive page to show only event in the future, and in chronological order based on a meta value (start date). I want to make ...
1
vote
1answer
288 views

Custom archives function

I'm working on building a custom archives page for my church's website. On my archives page I want to have last week's sermon shown at the top in a special box, followed by the future sermons and then ...
1
vote
2answers
2k views

Custom Post Type with has_archive ignores my custom archive and single template

I'm trying to set up a new CPT called news (see code here: http://pastie.org/3148081) and I'm specifying the has_archive parameter. I've set up a new template called archive-news.php and ...
1
vote
1answer
614 views

Extending AZIndex plugin to use custom post types and custom taxonomies

I desperately need to be able to display something exactly like this: http://bottlesup-07112011.31two.com/bottlesup-retailers/ 5 columns of custom post type posts sorted alphabetically by custom ...
1
vote
1answer
196 views

How to use has_archive but disable feed per post type?

What is the best way to disable feeds per post type but keep has_archive enabled?
1
vote
1answer
629 views

An empty Custom Post Type Archive page returns 404 in WP 3.1

I have set up a Custom Post Type called "Portfolio". If I view the CPT's Archive page without adding any posts to it (/portfolio or /?post_type=portfolio), it returns a 404 page. Is there a way to ...
1
vote
0answers
24 views

Is it possible to have a custom post type with feed but without the archive?

In Wordpress 3.9.2 I couldn't find the way to have a custom post type which would have the feed permalink like this: example.com/custom-post-type/feed/ But didn't show the archive (show 404) ...