[Resolved] customizing generate_do_template_part

Home Forums Support [Resolved] customizing generate_do_template_part

Home Forums Support customizing generate_do_template_part

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #2141517
    eric

    Hi there,

    I’m trying to modify the titles and featured image by making changes to the code that is called by this line:

    generate_do_template_part( ‘single’ );

    I’ve read posts like https://generatepress.com/forums/topic/generate_do_template_part-vs-custom-template-in-child-theme/ and would like to pull up my own template. I would like to use a command like this

    generate_do_template_part( ‘single-landingpage’ );

    to pull up a copy of the single.php file named ‘content-single-landingpage.php’

    The issue is that it this comamnd is not accessing the file. Could you let me know what I’m doing wrong? Thank you in advance.

    #2141532
    Ying
    Staff
    Customer Support

    Hi Eric,

    Is your landing page a static page?

    If so, you need a copy of content-page.php and page.php, then rename them to eg. content-home.php and page-home.php (I assume homeis the slug of your landing page)

    Then replace this line generate_do_template_part( 'page' ); in page-home.php with get_template_part( 'content','home' );

    Let me know if this helps 🙂

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.