• Resolved lucsar

    (@lucsar)


    Hi,

    I would like to copy the hero section from the page-template into a wordpress empty page, in order to change the background image (featured image not showing for some reasons …)

    Here the code of the page-template to render :

    <!-- wp:template-part {"slug":"header","theme":"travey"} /-->
    
    <!-- wp:pattern {"slug":"travey/gutenverse-page-hero"} /-->
    
    <!-- wp:pattern {"slug":"travey/gutenverse-page-section-1"} /-->
    
    <!-- wp:template-part {"slug":"footer","theme":"travey"} /-->

    So I copy/paste only the 2 on the middle in my empty wp page (no header and footer needed as they’re automatically injected in)

    The result is that I can change yes my section background but I get also a floating image in the middle of the main section (see screenshots)

    https://paste.pics/7a0d6f064d43756b120af4877ebf57c4
    https://paste.pics/99a59386c1b26d7bf2d38f045ae27c1f

    What’s wrong ? Maybe there’s another way/workaround for achieving this ?

    • This topic was modified 2 years, 5 months ago by lucsar.
    • This topic was modified 2 years, 5 months ago by lucsar.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Pradnya

    (@pradnyajegstudio)

    Hi @lucsar

    I will explain a little about block themes (template)

    • There are several templates available. Some of them, such as Search, 404, etc, are reserved for the default WordPress.
    • When you create a page, the template default is Page.
      There will also be about, contact, etc (all lowercase string) https://prnt.sc/6WlUkZ22KoYV These pages are assigned, and you can add more by clicking the new button
    • You can access a list of templates from Appearance > Editor > click on the top bar there is a dropdown with Front Page > Browse All Template

    In your case, you create a new page and use the default template (page). The floating image comes from your page content by the travey/gutenverse-page-hero render code. Whereas, a background image and navigation come from the page template. In the page template, there is a Post Content block. This block will render the content you added to the page. If you want to create a page with entirely new content, you can add a new template and assign your content to that template.

    For your issue with the featured image not showing, can you explain the details?

    Thread Starter lucsar

    (@lucsar)

    Hi @pradnyajegstudio

    Thank you for your reply.

    Yes, I could create a new template as described in your previous post (1). I’ve then added the following render code (2) to it and assigned to my wp page (3)

    <!-- wp:template-part {"slug":"header","theme":"travey"} /-->
    
    <!-- wp:pattern {"slug":"travey/gutenverse-page-hero"} /-->
    
    <!-- wp:pattern {"slug":"travey/gutenverse-page-section-1"} /-->
    
    <!-- wp:template-part {"slug":"footer","theme":"travey"} /-->

    (1) from the wp page (not from the site editor)
    (2) from the site editor to my newly created template
    (3) from the wp page

    About the featured image, it doesn’t shows up when inserted.
    https://prnt.sc/9KRKZ8iRKniN
    https://prnt.sc/6CbsruoIDw44

    • This reply was modified 2 years, 5 months ago by lucsar.
    • This reply was modified 2 years, 5 months ago by lucsar.
    Pradnya

    (@pradnyajegstudio)

    Your steps are correct in creating a new page using a new template.

    For the feature image, did you mean to change the image under the page title (test page)? If yes, actually it is not a featured image. It is a background image, you can change it by changing the Background Image option in Section block settings.
    https://prnt.sc/fnbmJ4flOdh4

    We have a block named Featured Image to add if you want to show the featured image. You can search for it in the block list. Once you add, the image placeholder will be shown on the page template editor. But if you preview your page, the featured image will be rendered.
    https://prnt.sc/gZaIMDl79rsU

    Thread Starter lucsar

    (@lucsar)

    Yes, I meant the featured image.

    So I followed your steps and now featured image shows up. Thank you

    Pradnya

    (@pradnyajegstudio)

    You’re welcome @lucsar
    Glad to hear that.

    Also if you don’t mind, please leave us a review about your experience using our plugin. It will help us a lot to grow the community, improve our plugin, add features and provide the best experience for our users.

    If you have other issues using our plugin, let us know.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Copy of the Hero Section from Page-Template (Travey)’ is closed to new replies.