[Resolved] Adding code to Blog page

Home Forums Support [Resolved] Adding code to Blog page

Home Forums Support Adding code to Blog page

Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #1159808
    Michael

    Hi all,

    I have set up my Blog page to display the posts on my site. However in so doing it removed the HTML code I had set up on the page to display the page title as per the other pages. I cannot see any way to add the HTML code back in – please could you tell me how I go about doing this?

    https://reclaimdesign-383226.easywp.com/blog.html/

    #1159873
    Leo
    Staff
    Customer Support

    Hi there,

    I’m not sure if I understand.

    What code are you trying to add to the blog page?

    The link above shows “default backend – 404” to me.

    #1159877
    Michael

    Hi Leo,

    Sorry, the page is now:

    https://reclaimdesign.org/blog.html/

    I’d like to add this at the top of the page as per the other pages:

    <table class="header">
    <tbody>
            <tr>
                <td class="center">
                    <header>
                        <h1>Blog</h1>
                    </header>
                </td>
            </tr>
    </tbody>
    </table>
    #1159893
    Leo
    Staff
    Customer Support

    How are you adding it on other pages? Just inside the content?

    The posts page cannot be edited like a normal static page so you’d need to use a hook with hook elements:
    https://docs.generatepress.com/article/hooks-element-overview/
    https://docs.generatepress.com/article/hooks-visual-guide/

    #1159933
    Michael

    Hi Leo, I just added html on other pages via the page edit area in the WP dashboard. I just need to add the title to the blog page as it’s the only one missing. Can I do that with a hook?

    #1159942
    Leo
    Staff
    Customer Support
    #1160018
    Michael

    Hi Leo, um, please can I get some help with how to code that just for the blog page? My brain is flat-lining 😉

    #1160030
    Leo
    Staff
    Customer Support

    Try creating a header element, add that as the page hero content:
    https://docs.generatepress.com/article/how-to-create-a-page-hero/#step-1-add-the-content

    Under the display rules, select Blog as Location.

    #1160300
    Michael

    Hi Leo,

    For some reason I don’t see the menu option mentiond:

    To create a new Header Element, go to Appearance > Elements and click “Add New”. From the Element dropdown list, choose “Header”.

    #1160302
    Michael

    Is there a plugin I need or something like that? I had to turn off a bunch of plugins whilst troubleshooting site stuff. I left the GP one one though

    #1160305
    Michael

    Sorry Leo, I have found it. It works but I was hoping to place the header underneath the social media icons as per my other pages eg:

    https://reclaimdesign.org/home-decor-products-faq.html

    #1160673
    David
    Staff
    Customer Support

    Hi there,

    you can use a Hook Element instead of the Header Element – the before_main_content hook should put it in the right place.

    If that is the same hook you have for your social icons then increase the Priority value of this new hook to move it below.

    #1160763
    Michael

    Hi David, you’re a legend Sir. That works too. Thank you very much – you are saving what little hair I have left 😉

    #1160768
    David
    Staff
    Customer Support

    You’re welcome

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