It’s a one-page theme where a certain amount of posts appear on the front page and the older ones appear on the archive page. Because not having a page header was confusing, I manually added the code below.
<div class="row"><h1 style="text-align:center;font-weight:bold; font-color:#4b2acc;front-family:EB Garamond; ">News and Events Archive</h1></div>
However, I am adding a two new categories that we plan to use heavily and so the above hard-wired coding doesn’t do the job.
I looked on the web and got a lot of articles,but all had a differnt frame of reference and I found it
confusing.
All I need is the proper code in place of the
News and Event
so that the page heading will reflect the category of the listing.
Much appreciated for any help
]]>I’m trying to create an archive custom page for my blog. I’ve created the archives.php and I added it as a template for the page I’ve created to receive the archive. Just to see if anything would happen, I had this code above, but the page comes out blank, no header, nothing.
<?php
/*
Template Name: Arquivo
*/
<?php get_header(); ?>
<div id=”archives”>
test.
</div
<?php get_footer(); ?>
what am I missing? I know all the code to get the actual archive is missing, but I don’t know why nothing is showing up in the first place,
my blog is https://www.ritabranco.net/ and this page should come in the post dates.
thank you.
]]><?php if ( $paged < 2 ) : ?>
<p>Text for first page of Category archive.</p>
<?php else : ?>
<p>Text for subsequent pages of Category.
Can be left out.</p>
<?php endif; ?>
I had tried playing with this and added the code just above the following code which allows me to add text to a specific category page:
<?php if (is_category('Category A')) : ?>
<p>This is the text to describe category A</p>
<?php elseif (is_category('Category B')) : ?>
<p>This is the text to describe category B</p>
<?php else : ?>
<p>This is some generic text to describe all other category pages,
I could be left blank</p>
<?php endif; ?>
The only thing that happened was that the text in the first code showed up on each category page.
I hope I didn’t confuse everyone. Any help would be greatly appreciated.
Thanks,
Brian
Can someone teach me how am I able to add Archives.php for the Delicacy theme from wordpress?
I can’t seem to find a way to add that as I do not have much knowledge on codings.
Please help
Thank you
Regards
Ben
I have two categories of posts on my site, for which I’d like to use the archives.php page.
I’ve already used it for REFERENCES.
I want to now use it for posts with a cat of NEWS, but the customisations I’ve done for REFERENCES don’t really work. Is there a way I can break to one archive page into two, or have a second archives.php page?
Thanks
dvent
I have created a separate page for listing the old posts. The archives.php was created using the document https://codex.www.ads-software.com/Creating_an_Archive_Index. I created the “Archives” template as it is without making any changes to the code and applied it to the page. The page was created fine but with one issue.
As you can see on this link, https://www.srpr.org/blog/?page_id=37, the sidebar gets pushed below the content section. Why is the content section taking up all the width? Any ideas? Thanks in advance for your help.
]]>Here’s the category.php file:
Thanks
<ul>
<li><a href="<?php echo get_settings('home'); ?>">Home</a></li>
<?php wp_list_categories('title_li=&include=44&hide_empty=0&depth=1'); ?>
<?php wp_list_categories('title_li=&include=4&hide_empty=0&depth=1'); ?>
<?php wp_list_categories('title_li=&include=9&hide_empty=0&depth=1'); ?>
<?php wp_list_categories('title_li=&include=45&hide_empty=0&depth=1'); ?>
<?php wp_list_categories('title_li=&include=43&hide_empty=0&depth=1'); ?>
</ul>
However if you visit www.xtracold.co.uk and test this out you will see that the Snow/MTB or Tech categories display correctly with a header div containing the category title and each post displayed separately. Click Journal and for some reason the title is not displayed and all posts are concatenated together into one long post.
Any ideas why this happens? I have tried to debug to make sure archives.php is being used to display the posts but I don’t think it is when Journal is loaded???
]]>I’d like to know what code I should add/change in order for it to archive all the posts. Here’s my archives.php file:
<?php
/*
Template Name: Archives
*/
?>
<?php while(have_posts()) : the_post(); ?>
<h1><?php the_title(); ?></h1>
<h3>Categories</h3>
<h3>Monthwise</h3>
<?php endwhile; ?>
<?php
$posts_to_show = 100; //Max number of articles to display
$debut = 0; //The first article to be displayed
?>
<?php while(have_posts()) : the_post(); ?>
<h3>All Posts</h3>
<?php endforeach; ?>
<?php endwhile; ?>
P.S: If you have time, please kindly also resolve my other query here
]]>