Questions tagged [archive-template]
The archive-template tag has no usage guidance.
177
questions
0
votes
2
answers
26
views
post loop with different design depending on post
I'm having a lot of trouble finding the solution.
I would like to loop my last 3 posts with wp-query.
I would like the 1st post to be in one div and the last 2 posts in another different div.
So when ...
0
votes
0
answers
15
views
blog archive page styled from default template instead of from custom template
I use latest WP version with the Twenty Twenty-Two theme.
I have created a custom template, named “Blog archive custom page” in order to use it for my blog archive page. I created a new page "...
0
votes
1
answer
24
views
How to return custom taxonomy term in title for archive?
I am building a site with 2 custom taxonomies (wired-categories, wired-types) assigned to a CPT (wired). I want to show the term in the page title when it is brought up using the taxonomy-wired-...
0
votes
0
answers
34
views
Pagination count and Pagination link not working in my buddypress template
I am trying to create a letter archive for the users on their buddypress profile page.
The letters are displayed in the profile page tab, but the pagination is not working.
$contest_args = array(
'...
0
votes
1
answer
43
views
How to make posts under custom post type not generate a URL / post
I have a custom post type called integrations, which is being used to host basic information for integrations.
Here's how I've registered the post type:
register_post_type(
'Integrations',
...
0
votes
0
answers
25
views
WordPress CPT archive page display sticky post first and then display the rest of the posts in same Query
I'm having one Custom post type I have added a Sticky Option to that Custom Post Type. When I choose the post as sticky means it's not working for me.
I have tried the below code.
Please don't add ...
0
votes
1
answer
771
views
Add custom display condition to Elementor Theme Builder for custom taxonomy children, grandchildren, and great-grandchildren
I have a few templates built with Elementor Theme Builder. However, the option to display them on nested archives is quite limited. Here's my case
I have a custom taxonomy (tags) called Locations. ...
0
votes
1
answer
49
views
Pagination not working only on Archive-Name.php using new WP_Query
I created an archive-sticky.php where I added the code below to show all sticky posts in one single page with pagination as there will be 100s of sticky posts in the coming days.
Now, this code ...
0
votes
0
answers
124
views
Is possible register two archive pages for single custom post type?
I have a custom post type registered with register_post_type( 'courses', $args ); (like documentation), and I use template archive-courses.php for page www.example.com/courses. I'm using this archive ...
0
votes
1
answer
24
views
Image loading function not working on archive.php template
I am using the following function to display a post thumbnail or ACF custom field image depending on the page type being viewed. This function is loaded from the inc/template-tags.php file in the ...
0
votes
1
answer
38
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 (/...
0
votes
0
answers
13
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' ),
'...
0
votes
0
answers
18
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 ...
0
votes
0
answers
14
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
...
0
votes
0
answers
633
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?
0
votes
0
answers
38
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 ...
1
vote
0
answers
106
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 ...
0
votes
1
answer
566
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 ...
0
votes
1
answer
28
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 ...
0
votes
1
answer
80
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 ...
0
votes
1
answer
57
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, ...
0
votes
0
answers
104
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....
0
votes
0
answers
74
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 ...
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(
...
0
votes
0
answers
265
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
1
answer
39
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
1
answer
23
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
1
answer
976
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
1
answer
26
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 ...
2
votes
1
answer
2k
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
1
answer
157
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
1
answer
808
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
0
answers
46
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
1
answer
73
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
0
answers
984
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
0
answers
53
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
1
answer
522
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
1
answer
2k
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
2
answers
3k
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
1
answer
194
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
...
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 ...
0
votes
1
answer
89
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
0
answers
182
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
1
answer
1k
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
1
answer
228
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
2
answers
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 ...
-1
votes
1
answer
107
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
1
answer
2k
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
0
answers
1k
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
2
answers
31
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://...