Site logo

Archived topic

How to Customise archive.php file from inc/structure folder in parent theme?

7 replies · Started by Sandeep on September 19, 2019

Viewing posts 1–8 of 8

Hello,

I want to customise archive.php file from inc/structure folder for that, I have created same sub folders in my child theme and added archive.php file from Generate Press Parent theme.

But, It is not working. Can you help me with this?

Thanks

Hi there,

I think you can just copy and paste that file in the child theme's folder without creating the same sub folders.

Can you give that a shot?

If not are you getting any specific errors?

Let me know :)

Hi Leo,

I have added archives.php file from Generate Press parent theme to my generate-press child theme in that theme folder. But, Still changes make on archives.php is not overriding to archives.php in parent theme.

What changes are you making?

I can't see the site without login and password but make sure to clear all caching plugins and server cache if you are using any.

Let me know :)

yes, you can see site by demo/demo123 user and password.

We want to change in archive title in Parent theme/inc/structure/archives.php

We have also tried by clear all cache.

Can you please check?

Hi there,

can you explain a little more of the changes you want to make, it may be possible without the need for a child theme template.

Hello,

1. I want to make changes inside the below file.
\themes\generatepress\inc\structure\archives.php

In the above file, I want to remove do_action( 'generate_before_archive_title' ); hook to hide Archives of title from Arhives.php page.

2. Is there any way to change in layout of Generate press theme by adding those files in a generate-child theme?

Thanks

You can make a copy of the archives.php - starting from the function_exists condition and place it in you child theme directories.

If you just want to remove the Archive Title then you can use this function:

add_action( 'after_setup_theme', function() {
    remove_action( 'generate_archive_title', 'generate_archive_title' );
} );
This archived topic is closed to new replies.