Questions tagged [archives]

A page showing more than one post in the main loop.

254 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
6
votes
1answer
1k views

Filtering a custom post type by custom taxonomy in archive template

I've seen this question posted in different forms before, but most of those solutions are centered around the admin interface, and I haven't found any answers that apply to the front end. I've got a ...
4
votes
1answer
211 views

Give attachments an archive page

I'm trying to override WP's default URL structure for attachments where, if they're attached to a post, the URL is /post-slug/attachment-slug/ and if not it's simply /attachment-slug/. What I'd like ...
4
votes
1answer
1k views

How do I display two separate taxonomy archives for two post types that share a single taxonomy?

I have a custom content type, "products", which shares the category taxonomy with posts. We're using posts to discuss and review products. The idea is to have two separate URLs: /discussion/...
3
votes
0answers
296 views

Prevent 404 when using pre_get_posts to filter an archive page

I have added a custom taxonomy named "area" to the default "post" post type. It's meant to organize posts by geographical area. In category pages I've added a dropdown that allows the user to filter ...
3
votes
0answers
24 views

display archive as collapsing links

I would like to output the following - 2015 -October - my post is good - another post September - 2014 - January -February I want to be able to output a nested listed of the ...
2
votes
1answer
263 views

Skip first post on Category Archive

I have created a filter to skip first post of the archive on "podcast" category. Below is the code. add_filter( 'pre_get_posts', 'amd_limit_posts'); function amd_limit_posts($query){ if (...
2
votes
0answers
58 views

URL scheme to retrieve tag archive by ID

You can retrieve a category archive by using a URL scheme like https://example.com/?cat=123. This even works if pretty permalinks are enabled. What is the equivalent query string for tags?
2
votes
0answers
112 views

Custom query in archive.php with pagination nightmare

I want to run a custom query showing only subcategories of a specific category inside my archive.php with pagination. But, for some reason, it keeps counting (and paginating) by the number of post ...
2
votes
3answers
6k views

How to edit archive page's content inside wordpress dashboard?

So basically, I have a page that is a custom archive showing a list of posts on it. The only issue is, the client wants to be able to edit the actual archive page content itself (image and title), not ...
2
votes
1answer
660 views

Display post links under month in paginated archive

I'd like to create an archive that lists posts under a month header. The months would just be plain text and the post titles, obviously, would link to the posts themselves! So: October 2013 Post ...
2
votes
1answer
247 views

Custom Post Types and archives

I have a custom post type: cats When I visit http://mysite.com/cats I see all of my cat posts displayed using the template file archive-cats.php I filtered getarchiveswhere to only return posts from ...
2
votes
1answer
612 views

How can I get archives for specific category without category_base in the url?

I'm using this code to get archives for a specific category: function extend_date_archives_add_rewrite_rules($wp_rewrite){ $rules = array(); $structures = array( $wp_rewrite->...
2
votes
2answers
10k views

404 Error On Category and Tags Pages

Okay So I'm facing a weird problem as i'm receiving 404 errors on blog category and tag pages. I'm using custom theme which includes: tag.php category.php archive.php home.php index.php and 404....
1
vote
0answers
12 views

Category archive rewrite rule to include category/subcategory?

I'd like to have my category archive (category.php) accessible using via a url structure like: mysite.com/mycategory/mysubcategory For example, I've got "health" as a category and "smoking" as its ...
1
vote
3answers
46 views

List of the years with posts presented

I need to get a list of the years with posts of given category. Like this: 2008, 2009, 2010, 2012, 2013 (if there were no posts in 2011, it's not included). I try this query, and it works — I get my ...
1
vote
0answers
28 views

Archiving by academic year instead of calendar year

I am building a website for a school where teachers can add posts for classwork. The posts are categorised by the class name (e.g Year 1, Year 2, etc). The academic year goes from September to July. I ...
1
vote
1answer
94 views

Wordpress showing archive.php instead page

I have a problem with same name (slug) for category and page and wordpress is showing archive.php instead page custom template. Permalinks settings for category is . and i want to stay this way but ...
1
vote
0answers
149 views

add_rewrite_endpoint returns 404 on archives

My endpoint works on all kind of single pages and homepage, but it returns 404 in archive pages, either categories or custom taxonomes. I have reflushed rewrites but I don't get it work. This is my ...
1
vote
0answers
75 views

How to add Post Format Taxonomy Archive page in the menu?

I have customized the archive template for the post format using the Wordpress template file structure. I have the file: taxonomy-post_format.php which works fine. The page is then accessible ...
1
vote
0answers
63 views

Adding tag's featured image to tag archive

I'm looking for a way to add a featured image to post tags, then display it on that tag's archive page. I currently have the name and description displayed in the sidebar, using a custom sidebar ...
1
vote
0answers
291 views

Create archive page for woocommerce attribute

I have a WooCommerce store with a selection of products. I have an attribute for brand. For some reason if I go to https://[my-domain]/brand I get a 404 page. I have flushed the permalink rewrites ...
1
vote
0answers
147 views

woocommerce custom taxonomy archive shows 404 error

Kind a new to wordpress. Trying to add two new taxonomis to woocommerce: product_color and product_category. The taxonomies are added and I see them under products categories, I even can add them ...
1
vote
1answer
37 views

Custom archive.php: retrieve right post categories?

I'm using a child theme where I edit archive.php. When somebody clicks on a post's category, I want the archive page to display all posts which share ALL of the categories of this post at the same ...
1
vote
1answer
189 views

wp_dropdown_categories() scripts working erratically on sidebar

(Posted this on the WordPress forum, but the notification of a reply went to my spam folder, so now it's dropped off the radar.) I have three dropdown menus in the site’s sidebar to create views by ...
1
vote
2answers
2k views

Two loops on archive page

I have 2 loops on the archive page. I want the first loop to display the 2 last posts of the category and the second loop offset 2 last post! <div class="top-posts"> <?php if (...
1
vote
0answers
115 views

How to override p2 breathe theme plugin in content template file?

I'm experimenting with a theme, P2 Breathe, the first o2-enabled theme that adds functionality like front-end posting. One difficulty is that when the plugin is enabled, most of the changes that I ...
1
vote
4answers
3k views

How to order posts by title after they have already been sorted by category

I'm not an expert at much, so please excuse me if this is an easy question... but it's got my head spinning. I have an archive template (adapted from a standard 'enfold' theme template) which I am ...
1
vote
0answers
725 views

Custom archive page for CPT UI

I have created a custom post type using CPT UI plugin, its slug is blog. I created a custom page named archive-blog.php. But WordPress always takes default archive.php. I'm confused what to do. I ...
1
vote
1answer
110 views

How to display custom post in archive section of the wordpress page?

I am using Wordpress Version 4.6.1. I created a Custom Post Type (CPT) named Portfolio. It works fine. But the problem is I want the custom posts to display in the archive('Archives') section of my ...
1
vote
0answers
35 views

If one taxonomy contains the same term as another then display post

Say I have 2 taxonomies (main-tax-1, sub-tax-2), I want to display a post in an archive if main-tax-1 displays the same term as sub-tax-2 and vice versa. I assume I'd have to add code in the ...
1
vote
1answer
430 views

Filtering out child category posts from parent category archive not working

In this example cat 5 is the parent category, and 42 is a sub-category. I the main category 5 archive I don't want any posts from sub-category 42 displaying. Why isn't this working? function ...
1
vote
0answers
117 views

Yearly Archive for Categories with dropdown

this is my first post, I already read a lot of threads and tried a few ways but none of them worked. I have a website with two pages, which show the posts of a categorie "news" and the other one shows ...
1
vote
1answer
836 views

How to remove category titles?

When I go into certain categories, there is a page title that says "Category: category_name", like this: I would like to remove the "Category" from that title. I've already looked around quite a bit ...
1
vote
0answers
142 views

Filter custom taxonomy archive posts by 2nd custom taxonomy using select dropdown

I have a CPT called 'online-lots' for displaying items in an auction. The posts are grouped by custom taxonomy called 'sale' (e.g. '07_15 July Sale)', meaning that a whole catalogue of items can be ...
1
vote
0answers
39 views

Having a problem with Next and Previous Links

I've run into an issue with next/previous (which I implemented on archive / author pages successfully by just following the codex instructions). I have created a custom category page for "Pine Trees" ...
1
vote
0answers
2k views

change default post archive page link

I can't figure how to change the default post archive link. I've got few custom post types (for instance video_news, slug video), if I type www.blogname.com/video I get the archive.php. And every ...
1
vote
0answers
53 views

Custom post type archive page thinks I'm not logged in

I have created some custom post types using the Types plugin, and created their archive pages by copying my theme's archive.php and renaming it archive-{post type slug}.php. When I view these archive ...
1
vote
0answers
578 views

How to conditionally check for author archive when is_author() fails to work because the author has no posts

I am using the author archive to output user profiles, however the is_author() function only works if the author has a post. If I visit an author archive page directly IE: /author/author-11, it has ...
1
vote
0answers
66 views

Use “archive” as slug for custom post type

I need to have a custom post type slug and its associated taxonomy's slug to have value "archive". Any other value is ok, I've tested it, so there is no problem with the code per se. I guess the path ...
1
vote
1answer
834 views

next and previous year month and day for archive page

is there php code for next and previous year,month,day link in archive page i just need something like that <-previous [year] next-> <-previous [month] next-> <-previous [day] next->...
1
vote
0answers
577 views

Custom Taxonomy Term Archive Page Template that Filters 2 or more Taxonomies

For a local directory, i have a 'businesses' CPT with 2 taxonomies - 'location' and 'type'. I am trying to figure out the best way to create taxonomy term archive pages such as: example.com/state/...
1
vote
0answers
370 views

Pagination in relation to archive.php

A small problem here, I just don't know how to change this because I'm a self taught newbie. I made a child-theme from the simone-theme with a static front-page. To it I have the archive.php as the ...
1
vote
2answers
1k views

Archive pagination not working

I am trying to add pagination for my Archive. I want to show 12 posts per page and then show the 'next' / 'previous' buttons. When I manually change the value of the $paged variable, the 1 into a 2 ...
1
vote
1answer
62 views

Can't select blog month within archive category

I'm using Wordpress 4.1.1. I have come across a problem with my website archives. If I set the permalinks to default I can click on a category and then click on the date on the sidebar within this ...
1
vote
0answers
1k 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 ...
1
vote
0answers
220 views

How to use multiple archive templates for a taxonomy?

I have created a custom post type (product) with a taxonomy (brand). I need to have the basic archive pages (type A) and then custom ones (type B) to create a product comparison page which esentially ...
1
vote
0answers
120 views

Store partial database to an archive database time to time

As the community knows me that I'm not a PHP Developer by core, but trying to be one. With the company I'm working, I developed many WordPress powered News Portals, where- They publish at least 30 - ...
1
vote
0answers
473 views

custom taxonomy archive by year

there is one custom post type News there are 3 taxonomy terms(like category). 1). press-release 2). in-the-news 3). events i have list out all this three category. now what i am looking for is to ...
1
vote
2answers
1k views

Custom post type / taxonomy rewrite archive page 2 gives 404

I've followed the code based off this and everything is working perfectly -How to create a permalink structure with custom taxonomies and custom post types like base-name/parent-tax/child-tax/custom-...
1
vote
0answers
217 views

wordpress archive a user

Please note this question was originally created in stack overflow. I have moved it here due to recommendation. I apologize if this can be answered elsewhere. I tried searching around with no answers....