Questions tagged [archive-template]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
0answers
12 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 ...
0
votes
1answer
17 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, ...
0
votes
0answers
7 views

Page template defaulting to index.php

I have a custom post type registered but don't want to use the archive page for it. I instead want to use a page template and just run WP_Query on it. On my localhost this works 100% but when ...
0
votes
1answer
18 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 ...
1
vote
1answer
42 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 ...
0
votes
0answers
10 views

Add copy to individual taxonomy and term archive page

I have a product attribute setup as 'style' and a term of 'illustrative', so I wanted to add some seo copy to the bottom of the illustrative archive page of my woocommerce shop using the hook '...
0
votes
1answer
7 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 ...
1
vote
1answer
102 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: ...
1
vote
1answer
23 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 ...
0
votes
1answer
27 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, ...
0
votes
0answers
22 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?
0
votes
1answer
47 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 ...
1
vote
0answers
313 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 ...
1
vote
0answers
45 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 ...
0
votes
1answer
196 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 ...
1
vote
1answer
385 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(...
0
votes
2answers
653 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())...
0
votes
1answer
50 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 ...
0
votes
0answers
513 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 ...
0
votes
1answer
41 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 ...
1
vote
0answers
73 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 ...
0
votes
1answer
255 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 ...
1
vote
1answer
35 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(...
0
votes
1answer
734 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 ...
-1
votes
1answer
59 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(...
0
votes
0answers
417 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 ...
1
vote
0answers
500 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=""> <...
0
votes
2answers
20 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://...
0
votes
0answers
111 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' => '...
0
votes
1answer
77 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 ...
1
vote
1answer
603 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()...
0
votes
0answers
70 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 ...
0
votes
2answers
1k 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!
0
votes
1answer
378 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, ...
0
votes
1answer
125 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' , '...
2
votes
1answer
67 views

Last post is not showing up

I'm developing a custom template for a customer that wants in his website the possibility to filter posts by month. After creating an archive.php page and placing the widget "Archives" in my sidebar I ...
0
votes
1answer
56 views

How to get the archive post type/format in the loop?

How do I find out if the archive is a post format, like 'gallery' (www.example.com/type/gallery/)? I can use is_archive() and and is_search() for those. Is there something like is_type() or ...
1
vote
1answer
1k views

get_terms in a taxonomy template

I've two custom taxonomies, and two template archives: taxonomy-brand.php and taxonomy-producer.php If I insert $terms = get_terms('brand'); in the taxonomy-producer.php I can't get terms for the ...
0
votes
1answer
22 views

Create secondary Archive page format?

I'm trying to create a Ajax based category menu that reloads a section of the page with a couple posts from a specific categories based on the category menu item the user clicked. Because my normal ...
0
votes
0answers
105 views

How to create a completely functioning separate archive for posts from only 1 or 2 specific categories

I can't seem to find a complete way of resolving my issue. I've found parts, but it seems I'm the only one out there who has the issue I do. I have a web working with WP, and recently I've been asked ...
0
votes
2answers
231 views

How to add html code at the bottom of the post in archive page?

I'm looking to add a formatted text at the bottom of each excerpt text when I read an archive page. The code is the same for all the posts. I have found for the category based archive page by ...
0
votes
1answer
793 views

Wordpress subcategories return 404 in custom template

I have a custom Wordpress theme and a main menu on top. This menu has links to different pages, one of them is a link to a Category (archive). It works fine for any first level category, but if I link ...
0
votes
1answer
72 views

I want to display all related posts for a selected tag in WordPress

I want to display all the related posts for a selected tag, my purpose is I display all the tag at my posts, if someone clicks on the tag, then it should be re-direct to my tag template tag.php. But I ...
2
votes
1answer
4k views

Change number of posts to show on Archive page (custom post type)

I've created a custom post type, and I've created an archive page to show them on this page. The number of posts shown by default is 10 but I'd like to reduce the posts' number to 6. I use this ...
0
votes
2answers
34 views

Which Template Page Should I Use?

I have created several custom post types (for example: FAQs, products and case studies) and registered a global custom taxonomy for use across all CPTs. In my case this taxonomy is called audiences. ...
0
votes
1answer
100 views

next and previous category name and link parent only wordpress in archive page

how get next and previous category name and link parent only wordpress in archive page I tried a lot but worked by fetching an ID and adding 1 or losing 1 But this is causing my mistakes
3
votes
1answer
4k views

Loading custom page template via plugin

I am following a rather outdated tutorial on custom post types and the last step is to create a custom page template, where this is intended to show all posts of the custom type in archive listing ...
0
votes
2answers
96 views

show ALL latest posts with archive.php on example.com/latest

I want to make a rewrite-rule for latest posts example.com/latest via rewrite_rules_array-filterhook and display the posts with archive.php. Usually this is what example.com/index.php does, I guess? ...
0
votes
1answer
587 views

Taxonomy template page not working

I have a taxonomy register with name doctor-services and I have a taxonomy template with name taxonomy-doctor-services.php but when I click on taxonomy link it does not display detail of the taxonomy. ...
0
votes
2answers
975 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 ...