Questions tagged [archive-template]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
6 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
14 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
23 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
19 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
45 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
67 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
41 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
115 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 ...
0
votes
0answers
18 views

How do I access blocks from the page used for the latest posts

I'm using a page called News & Events (permalink: news-events) for my posts page setting in the settings >> reading screen. I want to use blocks on this page and then access them on the index.php ...
1
vote
1answer
146 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
260 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
0answers
23 views

How can you display archive in grid form for a post type?

I want to upload a bunch of art and comics, and to do so I am using the plugin 'webcomic' Each collection is set as its custom post type, and the archive is presented as a list with thumbnails and ...
0
votes
1answer
43 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
316 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
32 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
51 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
95 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
20 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
397 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
54 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
271 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
371 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
70 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
67 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
406 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
56 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
283 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
100 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
43 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
46 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
931 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
19 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
67 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
141 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
625 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
37 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 ...
1
vote
1answer
3k 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
79 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
3k 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
88 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
472 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
700 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 ...
0
votes
2answers
497 views

get first limited words from a custom post in the archive page

I have created custom Post type. Now I am using excerpt to show some limited words in the archive page. but I am showing same posts on the homepage in a content slider (Owl Carousel) which is giving ...
0
votes
0answers
63 views

Override the else part of the index.php loop.

How do you prevent the else statement of the themes index.php from running in a custom archive page template. For example the default theme has: // If no content, include the "No posts found" ...
0
votes
1answer
235 views

Custom Post Archive is not working

I have created WordPress plugin for my custom post. I have tried all solution for archive, which I have found on Youtube and StackExchange but none of those are working. I have refreshed permalink ...
1
vote
1answer
112 views

How To Create A Custom Taxonomy 404 Page

I can't seem to find any documentation on this and Google is only showing results for people who have 404 pages caused by their incorrectly implemented taxonomies. I want to show a custom 404 page ...