- This topic has 15 replies, 2 voices, and was last updated 7 years, 4 months ago by
Tom.
-
AuthorPosts
-
October 29, 2015 at 8:55 am #148548
Mathijs Kooij
I used an other theme before and could just choose the page template archive for a paga and there it was! With GP I see no page templates and no way to create an archive for searching.
October 29, 2015 at 10:36 am #148563Tom
Lead DeveloperLead DeveloperHi there,
All archive pages are built automatically by WordPress.
Are you wanting some sort of custom template for your archives? If so, what kind of layout are you wanting to achieve?
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentOctober 29, 2015 at 12:25 pm #148582Mathijs Kooij
Ok, maybe I am missing something, how do I create this archive. On my last theme I just created an empty page, set the template to archive and it was there.
October 29, 2015 at 1:29 pm #148592Tom
Lead DeveloperLead DeveloperWhat did your last archive display? All of your posts? Specific ones?
WordPress creates archive pages by default by date, categories, tags etc..
Best way to find them is to use the “Archives” widget in “Appearance > Widgets”.
However, maybe your old archive displayed something differently?
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentOctober 29, 2015 at 1:32 pm #148595Mathijs Kooij
Thank you, i will install the old theme and make a screencap tomorrow. For now thank you for your great help.
October 29, 2015 at 8:41 pm #148701Tom
Lead DeveloperLead DeveloperNo problem π
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentOctober 30, 2015 at 3:23 am #148842Mathijs Kooij
Hello, I made a screenshot what I mean:
https://www.dropbox.com/s/h7flje5mtu1roi6/archivepage.png?dl=0
I hope you can help me.
October 30, 2015 at 10:23 am #148995Tom
Lead DeveloperLead DeveloperAh yea, GP doesn’t have an option like this.
However, you may be able to use a plugin like this to display posts from certain categories, dates etc..
https://wordpress.org/plugins/display-posts-shortcode/What theme were you using previously?
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentOctober 30, 2015 at 11:16 am #149019Mathijs Kooij
Thanks I will look into this, maybe even some better plugin. My last theme was evermore from pexeto.
October 31, 2015 at 12:06 am #149096Tom
Lead DeveloperLead DeveloperLet me know if you need any tips π
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentOctober 31, 2015 at 7:26 am #149150Mathijs Kooij
Thank you. I created a child theme (for some other options also).
Made a new page-archive.php in this and based it on page.php. It works now (code is below), but styling is all wrong, not enough experience. Could you look into it and see what goes wrong? The page I use it for is:
https://bestevaer.org/nieuws/archief/<?php
/*
Template Name: Archives
*/
get_header(); ?>>
<main id=”main” <?php generate_main_class(); ?>>
<?php do_action(‘generate_before_main_content’); ?><?php the_post(); ?>
<?php get_search_form(); ?>
<h2>Archieven per maand:</h2>
-
<?php wp_get_archives(‘type=monthly’); ?>
<h2>Archieven per onderwerp:</h2>
-
<?php wp_list_categories(); ?>
<h2>Archieven per Auteur:</h2>
-
<?php wp_list_authors(‘show_fullname=1&optioncount=1&orderby=post_count’); ?>
<h2>Alle pagina’s:</h2>
-
<?php wp_list_pages(‘title_li=’); ?>
<!– #content –>
<!– #container –>
<?php while ( have_posts() ) : the_post(); ?>
<?php get_template_part( ‘content’, ‘page’ ); ?>
<?php
// If comments are open or we have at least one comment, load up the comment template
if ( comments_open() || ‘0’ != get_comments_number() ) : ?><?php comments_template(); ?><?php endif; ?>
<?php endwhile; // end of the loop. ?>
<?php do_action(‘generate_after_main_content’); ?>
</main><!– #main –><!– #primary –>
<?php
do_action(‘generate_sidebars’);
get_footer();October 31, 2015 at 9:52 am #149182Tom
Lead DeveloperLead DeveloperYou’d want to do something like this:
<?php /* Template Name: Archives */ get_header(); ?> <div id="primary" <?php generate_content_class();?>> <main id="main" <?php generate_main_class(); ?>> <?php do_action('generate_before_main_content'); ?> <?php while ( have_posts() ) : the_post(); ?> <?php the_post(); ?> <?php get_search_form(); ?> <h2>Archieven per maand:</h2> <ul> <?php wp_get_archives('type=monthly'); ?> </ul> <h2>Archieven per onderwerp:</h2> <ul> <?php wp_list_categories(); ?> </ul> <h2>Archieven per Auteur:</h2> <ul> <?php wp_list_authors('show_fullname=1&optioncount=1&orderby=post_count'); ?> </ul> <h2>Alle pagina's:</h2> <ul> <?php wp_list_pages('title_li='); ?> </ul> <?php endwhile; // end of the loop. ?> <?php do_action('generate_after_main_content'); ?> </main><!-- #main --> </div><!-- #primary --> <?php do_action('generate_sidebars'); get_footer();
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentNovember 1, 2015 at 1:36 am #149288Mathijs Kooij
Thanks, but that did not work, not the complete syteling. I took the 404 page as a base and edited it. New code:
<?php
/*
Template Name: Archives
*/
get_header(); ?>>
<main id=”main” <?php generate_main_class(); ?>>
<?php do_action(‘generate_before_main_content’); ?><?php do_action( ‘generate_before_content’); ?>
<header class=”entry-header”>
<h1>Archieven</h1>
</header><!– .entry-header –>
<?php do_action( ‘generate_after_entry_header’); ?><?php get_search_form(); ?>
<h2>Archieven per maand:</h2>-
<?php wp_get_archives(‘type=monthly’); ?>
<h2>Archieven per onderwerp:</h2>
-
<?php wp_list_categories(); ?>
<h2>Archieven per Auteur:</h2>
-
<?php wp_list_authors(‘show_fullname=1&optioncount=1&orderby=post_count’); ?>
<h2>Alle pagina’s:</h2>
-
<?php wp_list_pages(‘title_li=’); ?>
<!– .entry-content –>
<?php do_action( ‘generate_after_content’); ?><!– .inside-article –>
<?php do_action(‘generate_after_main_content’); ?>
</main><!– #main –><!– #primary –>
<?php
do_action(‘generate_sidebars’);
get_footer();November 1, 2015 at 10:55 am #149516Tom
Lead DeveloperLead DeveloperAh yea, my bad. I adjusted my code above as well which should work now π
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentNovember 1, 2015 at 11:04 am #149526Mathijs Kooij
Thank you, but with my code I get the normal page (so it looks like al the other ones) with your adjusted code I get a full-screen page, I lose a part of the styling. For now I stick with the modified 404 pages, that works fine. Thanks for your help.
-
AuthorPosts
- You must be logged in to reply to this topic.