Archived topic
Archives
13 replies · Started by ROHART on March 4, 2023
Hi,
I am currently changing my wordpress theme to GeneratePress (which I already use on other blogs). For this, I do it on a clone site with the WP Staging Pro plugin.
I want to edit the archive and add the date, post author name, post categories and number of comments.
I checked the boxes in Personalization ▸ Layout ▸ Blog. But nothing is displayed. I saw the tutorial to add a piece of code in the function.php file here https://docs.generatepress.com/article/option_generate_blog_settings/ but even by adding this code, nothing is displayed.
Do you have an idea to help me to resolve the problem ?

Gregory
Hi Gregory,
I checked the boxes in Personalization ▸ Layout ▸ Blog. But nothing is displayed.
Can you make sure the Blog module is activated?
https://docs.generatepress.com/article/blog-content-layout/
https://docs.generatepress.com/article/blog-content-layout/#archives
You can also consider using a block element post meta as well if you prefer to create a custom layout:
https://docs.generatepress.com/article/block-element-post-meta-template/
Let me know if this helps :)
YHi Leo,
Yes, blog module is active. You can see here https://www.i-trekkings.net/wp-content/uploads/2023/03/capture-generatepress-archives-scaled.jpg.
That link isn't working for me.
Can you check? and please also take a screenshot of the Blog panel in the customizer.
Let me know :)
Sorry for the wrong link. You can see the screenshot here https://www.i-trekkings.net/wp-content/uploads/2023/03/screenshot-generatepress-scaled.jpg
Hi there,
is it possible to see the staging site ?
Yes, you can see my problem here https://clone.i-trekkings.net/destination/afrique/
Ah its a Custom Post Type (?) - if so then you need to tell GP to include the meta on that post type.
See here:
https://docs.generatepress.com/article/generate_entry_meta_post_types/
Yes, it is. Thanks, I will check that.
You're welcome
I managed to display the date, the author's name but I can't display the custom taxonomies. How I can do that?
Hi Rohart,
Try adding a snippet to create a Shortcode for your custom taxonomy. See here for an example: https://stackoverflow.com/questions/40595724/display-custom-taxonomy-by-shortcode#:~:text=By%20default%20add_shortcode%20return%20html.%20You%20can%20try%20the%20following%20code%3A
Example:
add_shortcode( 'YOUR_SHORTCODE_NAME', 'category_in_content' );
function category_in_content($atts){
global $post;
$html = '';
$taxonomy = 'YOUR-CUSTOM-TAXONOMY-SLUG';
$terms = get_the_terms( $post, $taxonomy );
if ( !empty( $terms ) ) {
foreach ($terms as $term) {
$html .= '<a href="' . get_term_link( $term, $taxonomy ) . '">' . $term->name . '</a>';
}
}
return $html;
}
Adding PHP: https://docs.generatepress.com/article/adding-php/#code-snippets
You may then add the shortcode [YOUR_SHORTCODE_NAME] through a Shortcode Block.
I find the solution in the same time. Thanks for your help.
You're welcome, Rohart!