Category page customization

Hi guys,

I’m writing you about a simple customization I need to make to all of my website’s category pages.

I just want to change:

“Category Archive”

…with the name of the Category and the subtitle:

“Below you’ll find a list of all posts that have been categorized as “Category Name””

…with the Category description. The final idea would be:

– Category Name –
Category Description

I need you to help me with this please… with up to date information… I mean information / code compatible with the X Pro version. I’m also using the last version of Wordpress and the child theme.

Thanks in advance!

Hi there,

This is a little bit outside our support scope but I will try to give a starting guide to customize the page. As I assume correctly you are using Pro and the Integrity stack, you can check that by going to Pro > Theme Options > Stack.

Kindly copy the file below from the theme:

wp-content/themes/pro/framework/legacy/cranium/headers/views/integrity/_landmark-header.php

To your child theme:

wp-content/themes/pro-child/framework/legacy/cranium/headers/views/integrity/_landmark-header.php

You will need to create necessary folders on your Child Theme

On line 26 you will see the section you mentioned which you can change as you wish:

   <p class="p-landmark-sub"><span><?php _e( "Below you'll see everything we could locate for your search of ", '__x__' ); echo '<strong>&ldquo;'; the_search_query(); echo '&rdquo;</strong>'; ?></span></p>

The Category Archive section can be replaced by changing the code on line 25:

<h1 class="h-landmark"><span><?php _e( 'Search Results', '__x__' ); ?></span></h1>

Thank you.

Hi @christopher.amirian and rest of the world,

Thanks for your “help”.

“…a little bit outside our support scope…”

About the text above: ¿This is new?

Well, I’ve written “help” because you certainly pointed to the right direction in your “starting guide” but it’s wrong at the end.

I’ve solved this by myself but taking in count what you said ("…a little bit outside our support scope…") I would like to share (for free) what I did with all the people (users of this theme) that would need to achieve the same behavior.

If you are using CPanel first go to:

wp-content/themes/pro-child/framework/

…and create the folder: “legacy” …and then go inside this folder and create the next one and so on. As @christopher.amirian mentioned the final path has to be:

wp-content/themes/pro-child/framework/legacy/cranium/headers/views/integrity/

…when this is done copy the file: “_landmark-header.php” …from the main theme folder to the child folder. I mean from this address:

wp-conten/themes/pro/framework/legacy/cranium/headers/views/integrity/_landmark-header.php

…toward the following empty folder that you just created:

wp-content/themes/pro-child/framework/legacy/cranium/headers/views/integrity/

If you are using a VPS as I’m you just have to execute the following commands from the root of your website folder:

$ sudo mkdir -pv wp-content/themes/pro-child/framework/legacy/cranium/headers/views/integrity/

…and then:

$ sudo cp -v wp-content/themes/pro/framework/legacy/cranium/headers/views/integrity/_landmark-header.php wp-content/themes/pro-child/framework/legacy/cranium/headers/views/integrity/

At this point: open for edition the file (_landmark-header.php) we just copied to the child theme folder and edit the lines 34 and 35 from the original version:

$title    = ( $meta['archive-title']    != '' ) ? $meta['archive-title']    : __( 'Category Archive', '__x__' );
$subtitle = ( $meta['archive-subtitle'] != '' ) ? $meta['archive-subtitle'] : __( "Below you'll find a list of all posts that have been categorized as ", '__x__' ) . '<strong>&ldquo;' . single_cat_title( '', false ) . '&rdquo;</strong>';

…to:

$title    = ( $meta['archive-title']    != '' ) ? $meta['archive-title']    : __( '', '__x__' ) . '<strong>' . single_cat_title( '', false ) . '</strong>';
$subtitle = ( $meta['archive-subtitle'] != '' ) ? $meta['archive-subtitle'] : __( '', '__x__' ) . '<strong>' . category_description() . '</strong>';

…save the file, clean your cache and that’s it. Now you will have the following format at the header of your category pages:

– Category Name –
Category Description

You can check how this looks at my website:

https://www.kodigoswift.com/tutoriales/algoritmos/

Finally @christopher.amirian’s instructions gived me also the idea of changing the text related with the search event to the language (Spanish) of my website. If you want to do this too: just change the lines 25 and 26 from the original version:

<h1 class="h-landmark"><span><?php _e( 'Search Results', '__x__' ); ?></span></h1>
<p class="p-landmark-sub"><span><?php _e( "Below you'll see everything we could locate for your search of ", '__x__' ); echo '<strong>&ldquo;'; the_search_query(); echo '&rdquo;</strong>'; ?></span></p>

…to:

<h1 class="h-landmark"><span><?php _e( 'Resultados de Busqueda', '__x__' ); ?></span></h1>
<p class="p-landmark-sub"><span><?php _e( "Aquí tienes todo lo que pudimos encontrar para la busqueda ", '__x__' ); echo '<strong>&ldquo;'; the_search_query(); echo '&rdquo;</strong>'; ?></span></p>

That’s all guys, I hope this can help someone else.

Cheers!

1 Like

Hi there,
Thank you for taking your time and sharing this solution with us.

Cheers