Questions tagged [archive-template]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
14 views

Links to previous/next month archives

On the month archive page (using the date.php template), how can I add links for the previous month and next month? For example, viewing January 2022 (/2022/01), I'd like a link to December 2021 (/...
user avatar
0 votes
0 answers
9 views

Custom post archive page not opening 404 page

I have custom post type like this register_post_type( 'workforce_archive', array( 'labels' => array( 'name' => __( 'Workforce Archives' ), '...
user avatar
0 votes
0 answers
21 views

How to create archive page to add in menu

I have a menu like this below But I can't find the page. Is this a wordpress page or template located somewhere? And how can I create archive page?
user avatar
0 votes
0 answers
11 views

Make the home page template my archive/category page template without code duplication

Exploring WordPress and bumped into this issue: In my theme root page-templates/home.php which is a common page template used in multiple pages. Now I want to include the same template (with some ...
user avatar
  • 101
0 votes
0 answers
13 views

Archive page of CPT's custom Taxonomy

I have a Custom Post Type: "Sponsors" Sponsors have a Custom Taxonomy: "Sponsor Ranks" Sponsor Ranks are divided like Platinum Sponsors - Gold Sponsors - Silver Sponsors and so on ...
user avatar
0 votes
0 answers
15 views

Strange behaviour of hierarchical taxonomy archive

Background: I have a hierarchical taxonomy and I'm trying to create a taxonomy template file that lists each of the child terms with the associated posts below each. So far I have managed to achieve ...
user avatar
  • 1,051
0 votes
0 answers
91 views

Is it possible to set archive.php instead of index.php to display blog?

I have index.php and archive.php in my theme, but I'd like to using archive.php to display blog and category posts. Is it possible to override index.php by archive.php?
user avatar
  • 1
0 votes
0 answers
31 views

Pagination links for custom post type shows correct number of links, but links result in Page not found

This topic has many similar posts, but I'm not finding one that addresses my issue precisely. Here is what I have done so far: I added a Custom Post Type to functions.php. This works. The imported ...
user avatar
1 vote
0 answers
69 views

Isotope Filtering with Bootstrap Tabs - Custom Post Type Query Loop in each Tab (Have to click twice to filter)

I am trying to use isotope filtering (cool animations) with bootstrap tabs where each tab-pane has its own custom post-type query loop. For some reason, I have to click twice on the tabs to have the ...
user avatar
  • 11
0 votes
1 answer
53 views

How to overwrite the category template in a plugin

So I basically need to overwrite my category template in my child theme with the one in my plugin but I can't seem to get it working. I have checked the files paths and everything and there all ...
user avatar
0 votes
1 answer
21 views

How do I custom a page that doesn't exist in the page list?

Many custom post types have their own archive page which doesn't exist in the page list, but I am able to customize these pages by finding the archive's template file. But for some other instances, I ...
user avatar
  • 117
0 votes
1 answer
58 views

How to integrate single and archive templates for custom post type in any Wordpress theme

I am working on my new WP Plugin for advanced control of custom post types and meta boxes. Actually, I am working on an HTML Builder for the full customization of single and archive templates for the ...
user avatar
  • 63
0 votes
0 answers
53 views

add custom button in archive page after every post excerpt?

I want to add custom button in archive page .add custom button in archive page after every post excerpt Reference https://ibb.co/h15xHZ8
user avatar
0 votes
1 answer
49 views

Add archive/category results to single post page

Have posts, want related categories to display under them. Post example: Artist name. Category example: posts with the Artist name. My current version, arrived at based on a comment from @birgire, ...
user avatar
  • 17
0 votes
0 answers
99 views

Landing in 404 Page on Navigating to Custom Taxonomy Archive

Can you please take a look at this post and let me know how I can navigate to Taxonomy URL properly? Having a CPT called movie and a Taxonomy called genre how I can navigate into archive of taxonomy....
user avatar
  • 191
0 votes
0 answers
21 views

How To Get the Correct Character length of the Category Archives Page Title

I am trying to get the character length of a category archive page. I know i can use $page_title_length = strlen(get_the_archive_title() ); However, for some reason, this gives a higher number than ...
user avatar
  • 105
0 votes
0 answers
46 views

I can't go to the page archive-{post_type}.php

Is my custom post type on function.php add_action('init', 'create_objects_type'); function create_objects_type() { register_post_type('objects', array( 'labels' => array( ...
user avatar
  • 101
0 votes
0 answers
103 views

setting offset to category number in archive page

unit test data added many category to some posts.so, on archive page, the long category list seems bad because you know its long, ugly. so, to solve this visual problem, I want to set offset to this ...
user avatar
0 votes
1 answer
34 views

Finding the CPT archive template source

I've created a CPT named kindergarten by a plugin ; I was able to see the archive page of this custom post type with its posts; When I was using Elementor for changing the template of this post type, ...
user avatar
0 votes
1 answer
21 views

Why is my archive page looping through all but one post?

I've created an archive page for my custom posts, it loops through every one except the first. There is 11 posts overall and I only get 10 on the archive page. Here is my archive template: <div ...
user avatar
1 vote
1 answer
530 views

Change archive page template using pre_get_post

I've used pre_get_post to modify and display my custom post type in an archive page with pagination which uses my custom created archive template, see here. It it displaying the posts exactly what I ...
user avatar
  • 13
0 votes
1 answer
17 views

Is it possible to have a template that works on multiple categories where the link address contains the specific category?

This question is for a very specific refinement on the use of WordPress template files. The refinement would work similarly to how default archive.php and variants work, but we would like to have a ...
user avatar
1 vote
1 answer
895 views

Rewrite URL for only archive page (custom post type)

There is a few Q/A about custom post URL rewrite but I haven't found any simple answer to what I'm trying to achieve. My CTP is "event" and I have the current page structure that I want to preserve: ...
user avatar
1 vote
1 answer
110 views

How can I define a custom archive for childs of a specific category?

I want to show several comics I make without having to rely on plugins (already tried them, each has some limitations I rather just do the work on my own). So I made a parent category called Comics ...
user avatar
  • 137
0 votes
1 answer
297 views

How to get posts by category at /%category%/ url?

I want to display titles of all posts of the "News" category at http://example.com/news. I have setup permalinks as http://example.com/%category%/%postname%/. I use archive.php template which, ...
user avatar
  • 115
0 votes
0 answers
39 views

Shortcodes not working in custom page

I have a plugin installed which provides shortcodes I regularly use on the site. But the shortcode is not working on custom page template. How do I fix this?
user avatar
  • 1
0 votes
1 answer
62 views

Template taxonomy-{taxonomy}.php doesn't show my posts

I have a simple issue that can’t solve. I have a Custom Post Type called “Hardware” and inside a taxonomy called “hardware_category”. I'm trying to display a list of my custom posts in each term with ...
user avatar
1 vote
0 answers
821 views

how do I add a button in each category to display all posts?

I have Create a page that lists posts by category but only shows 5 posts from each category. how do I add a button in each category to display all posts? Here's my code for a page that lists posts by ...
user avatar
  • 11
1 vote
0 answers
48 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 ...
user avatar
0 votes
1 answer
423 views

ACF Pro Accessing fields on a Custom Post Type

I'm an intermediate PHP user and I've been able to do some great things on my own with ACF but I could use some help. Instead of using an options page, I would like to add some fields to the Custom ...
user avatar
1 vote
1 answer
1k views

creating custom archive template within plugin for custom post type using archive_template filter

I'm trying to create category and tags archive template from my plugin that has custom post type 'product'. I used the below code to display search results in template file located at plugin_dir_url(...
user avatar
  • 31
0 votes
2 answers
2k views

how to pass args for archive.php query?

I am trying to pass args to archive.php so that I can order the posts, set the number of posts, etc.. but the query is done like this <?php if (have_posts()): ?> <?php while (have_posts())...
user avatar
0 votes
1 answer
126 views

Show products as posts on archive page

Usually products on shop pages show up with a single featured image title price and add to cart button like this https://prntscr.com/ngn7o6 , and do not follow the themes original styles and settings ...
user avatar
1 vote
0 answers
1k views

Why is my site using index.php instead of archive?

Developing my first custom theme and I started out using an individual page-$slug.php to display a list of each custom post. Have since learned that archive.php is better for this purpose (but I just ...
user avatar
0 votes
1 answer
78 views

BuddyPress : how can I call the template Wordpress would have chosen (template hierarchy)?

playing with BuddyPress here ! I made some new user profile pages, and when I display the content, I want to make a new posts query, and display the loop. Thing is, I want to display that loop using ...
user avatar
  • 452
1 vote
0 answers
137 views

How can I use $wp_query->tax_query as tax_query parameter for a new WP_Query instatiation?

I am trying to use $wp_query->tax_query right out of the box as tax_query parameter, however I cannot work this out. The parameters for my new WP_Query is actually the same as the default query of the ...
user avatar
0 votes
1 answer
867 views

How to list articles by year based on url?

Hie all, I am trying to list posts by year based on the provided url (for example: wordpressite.com/2004 - this should list all articles created in 2004), unfortunately all suggested methods from ...
user avatar
  • 7
1 vote
1 answer
143 views

Duplicated posts on category page

So, I have archive.php file with this part of code <div class="column is-full is-three-quarters p-small"> <?php while ( have_posts() ) : the_post(); get_template_part(...
user avatar
  • 157
0 votes
1 answer
2k views

Wordpress override archive page template using a plugin

I am editing the archives template of my wordpress archive pages for specific post types and taxonomies only and I want to package it all in one plugin instead of adding it on my functions folder and ...
user avatar
-1 votes
1 answer
85 views

IF taxonomy archive is hierarchical THEN

I'm trying to put in a conditional in my archive.php that sorts our whether the taxonomy is hierarchical or not. This is what I have so far but it doesn't work. <?php if ( is_taxonomy_hierarchical(...
user avatar
  • 976
0 votes
1 answer
993 views

Pagination not working past page 3 on archive page of category

I have a custom post type of "show" and within that custom post type I have set up a taxonomy / category called "venue" which has two options "venue-one" and "venue-two" (slugs). On the two archive ...
user avatar
  • 21
1 vote
0 answers
870 views

Filter posts in category archive page by year using a dropdown

I'm trying to filter my posts by year in different categories by changing the query using a dropdown with this code: <form method="post" action=""> <...
user avatar
0 votes
2 answers
28 views

URL rewrites af

I'm trying to make some pretty URLs that show content from a category page. An example would be this: https://example.com/resources/white-paper (not a real WP page) would show content from https://...
user avatar
0 votes
0 answers
214 views

PageNavi redirects to 404 when used as archive page

I'm using a page as archive for a custom post type called event. register_post_type('event', array( 'labels' => array( 'name' => 'Événements', 'singular_name' => '...
user avatar
0 votes
1 answer
120 views

archive_template override when no posts exist

I have a plugin which contains a single PHP template for both single_template and archive_template for multiple post types. I am loading a client side application in this template, which is why I only ...
user avatar
  • 105
1 vote
1 answer
1k views

Only one post is showing on category page, why?

My website categories are only showing one recent post, not all. category.php code looks like this: <?php get_header(); /** * The template for displaying Category pages */ quality_breadcrumbs()...
user avatar
0 votes
0 answers
130 views

My archives page won't sort posts by month

I'm trying to make my own theme and I've created an archive template that works fairly well. The template shows all posts, but the problem is that all posts will show if I go to /2018/11/ (posts were ...
user avatar
  • 133
0 votes
2 answers
2k views

How to Completely Remove Archive Title a.k.a the_archive_title?

I want to remove it COMPLETELY. Not only the label "Archive: " but EVERYTHING. It should not appear. I've been looking for the solution for hours to no avail. Please help. Thank you!
user avatar
0 votes
1 answer
532 views

Change Title Based on Taxonomy Filter in archive-{cpt}.php

So I have page in Custom Post Type RENTAL with following custom taxonomies: Merk -- with terms: Honda, Daihatsu, Toyota, etc Kendaraan -- with parent terms: Mobil, Bus, Motor; & child terms: MPV, ...
user avatar
0 votes
1 answer
211 views

Multiple Custom Post Type in Taxonomy Archive Causing White Screen

So basically I'm trying to add multiple custom post type in my taxonomy archive. Here's my code: <?php $args_trip = array ( 'post_type' => 'trip' , '...
user avatar