[Support request] Change Div Tag of Query Loop to Article Section

Home Forums Support [Support request] Change Div Tag of Query Loop to Article Section

Home Forums Support Change Div Tag of Query Loop to Article Section

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #2320660
    jaypabs

    I’ve been using Thesis theme before. And the top 10 recent posts in the front page is formatted as Article section as show below:

    Article section

    In GeneratePress query loop, how do I format it to use Article section instead of Div tag as shown below?

    Query loop

    #2320762
    jaypabs

    I found that you have some semantic in Query Loop widget but it’s lacking the Article.

    Semantic

    Is it possible that you can add it? Or else I have to buy Elementor plugin just because of this.

    #2320770
    Fernando
    Customer Support

    Hi Jomar,

    There’s a filter for this. Specifically – generateblocks_container_tagname. I raised a bug ticket as there might be a bug regarding it and the tag name for the Query Loop Block.

    You can find it here: https://github.com/tomusborne/generateblocks/issues/665

    #2320786
    jaypabs

    Hi Fernando,

    Thank you for acknowledging this. I hope this can be fix ASAP as this is very important for SEO.

    #2320788
    Fernando
    Customer Support

    You’re welcome Jomar! Hopefully it does.

    #2321064
    jaypabs

    Just an update. We temporarily created a script to add the “article” semantic.

    Please see screenshot below.

    article semantic

    However, the first “article” above should be change to “div” or maybe “section”?

    #2321124
    David
    Staff
    Customer Support

    Hi there,

    for the GB issue, we will be adding options for the article element tag.

    The second issue, the article element is itself a sectioning element and its perfectly valid to nest another article within it.

    If you want to change the top level tag then you would need to create your own child theme copy of the content-single.php

    https://github.com/tomusborne/generatepress/blob/8c515ebb1b74637a8bd8a38f7bfaa55e22101b52/content-single.php#L13

    or content-page.php

    https://github.com/tomusborne/generatepress/blob/8c515ebb1b74637a8bd8a38f7bfaa55e22101b52/content-page.php#L13

    And update the tag and closing tag as required.

    #2321831
    jaypabs

    Hi,

    I forgot to mention that I am using this page on my frontpage. That’s why I need to change the article element to something like section or div.

    I already added content-page.php to my child theme and created a condition that if the page is in the frontpage it will change to section else use article.

    #2322132
    David
    Staff
    Customer Support

    Is that working for you now ?

    #2322274
    jaypabs

    Yes, though I have temporary fix on the first issue which is the options for the article element tag. I still wanted that you integrate it on the next update. This is very important for SEO.

    #2322303
    David
    Staff
    Customer Support

    Glad to hear that.

    The article template tag will be added to the plugin very soon.

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