People who code: we want your input. Take the Survey

Questions tagged [archives]

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

290 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
5
votes
0answers
407 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 ...
5
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/...
4
votes
2answers
392 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 ...
3
votes
1answer
725 views

Link for the page archive for posts, like using custom post types with get_post_type_archive_link

I am trying to get the page to list all my posts (post type = post) in archive. I can do this with custom post types, with get_post_type_archive_link(), but using get_post_type_archive_link('post') ...
3
votes
0answers
25 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
452 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
72 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
135 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
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 ...
2
votes
1answer
690 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
254 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
688 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->...
1
vote
0answers
26 views

archive by year and category: permalink support doesn't work on pagination

I found here: Category archive by year with permalink support /category/YYYY the solution to obtain a category-by-year archive also supporting perma: function catyeararchives_init() { ...
1
vote
0answers
12 views

Category being displayed without base parmalink

My permalinks are set as /%category%/%postname%/ But I am getting duplicate pages domain.com/category/jazz is also the same as domain.com/jazz I do not want domain.com/jazz to display as an archive ...
1
vote
0answers
14 views

How to change category and year archive permalinks/rewrite rules?

first of ll I'd like to find a way to substitute 'category' with 'events' in permalinks. Currently I've got this: http://example.com/category/post-name/ And I would like it to be: http://example.com/...
1
vote
0answers
11 views

Set specific number of columns for top level term on product category archives

I'am a bit desperate about this issue im facing. I have tried so much o code tweaking, asking for help and nobody really could help me, maybe this is the place where some one could at least explain ...
1
vote
2answers
32 views

Group Posts by Category in Monthly Archive

I'm using the monthly archives on my website but my loop is currently displaying my posts this way : Category title Post title 1 Category title Post title 2 etc.. What I want to do is displaying all ...
1
vote
0answers
33 views

A clean custom rewrite rule for weekly archives

Weekly archives are nearly undocumented, but WordPress can produce them, which I want. Good. But the URLs are ugly, eg. http://example.com/?m=2020&w=18 This gets partially rewritten to /2020/?w=...
1
vote
0answers
318 views

How to reverse the pagination numbers of an archive?

I have archive pages that each contain titles and excerpts from 10 blog entries. Both entries and archive pages are in reverse chronological order: when a new blog entry is written its title and ...
1
vote
0answers
286 views

Fetch Children of Grouped Products Inside WooCommerce Product Loop

I am overriding the WooCommerce archive-product.php in a child theme so I can list single products and grouped products. The loop outputs each product as a single item which is what I want for Simple ...
1
vote
0answers
54 views

Loop through years and months in Wordpress archives

In wordpress, Im trying to loop through every year archives, displaying a list of every mouth per year. The html output should look like this: //year output <ul> <li> 2020 //month ...
1
vote
0answers
34 views

How to get post type and month/year before while loop for date.php file

I am trying to create a date.php file for archives for some custom post types. I am using a while loop to get the posts: <?php while (have_posts()) : the_post(); ?> I want to customize the ...
1
vote
0answers
23 views

Dropdown to select posts by month and then displaying those posts in the archive page

I get how to select posts by month with a dropwdown, according to the Codex: <select name="archive-dropdown" onchange="document.location.href=this.options[this.selectedIndex].value;"> ...
1
vote
1answer
39 views

Get parrent category name

I have 3 levels of categories: Cat 1 - Cat 2 - Cat 3 -- Cat 4 I want to add Parent category name after page title. For example: <h1>Cat 4</h1> <p>From Cat3 in Cat 1</p> But ...
1
vote
0answers
47 views

Restoring default article pagination on archives – Removing custom limits

I am working on a website that is a customised WordPress installation running WP 5.2.4. There are a number of categories, as follows: main_category (id 71) other_cat_1 other_cat_2 etc. The post ...
1
vote
0answers
21 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
0answers
78 views

WooCommerce product archive url without value / all values

Is is possible to list all products by a certain attribute without specifying the term value ? Right now, accessing site.com/attribute_name/term_value/ returns as expected. Accessing site.com/...
1
vote
0answers
33 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
167 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
287 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
170 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
2k views

Multiple category archive page

I am trying to create an archive page that shows posts that are in two categories in the same list. The listing should only contain posts that belong to BOTH categories, and not posts belonging to ...
1
vote
0answers
262 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
498 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
2answers
1k views

Custom post type archive page blank

I created a CPT with slug plist via cutom plugin I made. In my local host the archive work but in live server it return blank page. Here is the 'include' archive page code /** * Add Price List ...
1
vote
0answers
185 views

Custom taxonomy archive shows 404 error

Kind a new to wordpress. Trying to add two new taxonomis to woocommerce: product_color product_category The taxonomies are added and I see them under products categories, I even can add them to ...
1
vote
1answer
90 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
1k views

Order archive results by post id in custom taxonomy template

My theme's archive template uses this for the loop, <?php if (have_posts()) : while (have_posts()) : the_post(); ?> Seems to be ordered by post title but I need them ordered by the post id. ...
1
vote
1answer
543 views

Page redirects to archive

I have a page with a permalink of /news and when i go to that page it redirects me to archive pages. I only want to go my news page and not redirect me to archive. Please help.. thanks
1
vote
1answer
214 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
3k 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
133 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
5answers
4k 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
1k 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
125 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
36 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
505 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
128 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
0answers
183 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
2 3 4 5 6