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

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

  • This topic has 7 replies, 3 voices, and was last updated 1 year ago by David.
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #1013456
    Sandeep

    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

    #1013753
    Leo
    Staff
    Customer Support

    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 🙂

    #1013970
    Sandeep

    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.

    #1014038
    Leo
    Staff
    Customer Support

    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 🙂

    #1014138
    Sandeep

    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?

    #1014263
    David
    Staff
    Customer Support

    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.

    #1015684
    Sandeep

    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

    #1015770
    David
    Staff
    Customer Support

    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' );
    } );
Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.