• Resolved tbronson

    (@tbronson)


    Which page do I edit to customize the loop that displays the blog index. (I want to customize the blog index page so that sticky posts display second: display latest post, then display all posts starting from the second post.)

Viewing 8 replies - 1 through 8 (of 8 total)
  • Leo

    (@leohsiang)

    Hi there,

    The blog page posts loop is out of the theme’s control as it’s handled by WP’s core function: https://developer.www.ads-software.com/reference/classes/wp_query/

    It cannot be edited easily unfortunately. You can try checking with WP’s support team for further assistance.

    Thanks for your understanding.

    Thread Starter tbronson

    (@tbronson)

    Thanks! But where in the theme is the standard blog loop called, so I can replace it?

    • This reply was modified 1 year, 1 month ago by tbronson.
    • This reply was modified 1 year, 1 month ago by tbronson.
    ying

    (@yingscarlett)

    There isn’t a theme file controls the order of the blog posts, you will need to contact WP’s support for this.

    Thread Starter tbronson

    (@tbronson)

    OK, thanks! Putting “home.php” in the child theme didn’t seem to work, so I wasn’t sure what was going on, but it was maybe a cache problem, because it’s working now.

    • This reply was modified 1 year, 1 month ago by tbronson.
    Leo

    (@leohsiang)

    I don’t believe that’s the correct method but glad it’s working for you.

    Thread Starter tbronson

    (@tbronson)

    @leohsiang Since you mention it, what would the correct method be? I’m reading how-tos, figuring out as I go. Instead of an index.php or home.php in the child theme, I might try a custom index page template by setting the homepage to static and selecting it. I read a bit about the pre_get_posts action hook, that didn’t seem like it would work for multiple loops.

    Leo

    (@leohsiang)

    I’m not entirely sure either. As mentioned a couple times already, the post loop is completely handled by WP core so you will need to check with their support team for further help.

    If the method works in a Twenty series WP standard theme, the exact same method would apply in GeneratePress.

    Thread Starter tbronson

    (@tbronson)

    OK, thanks for the follow-up. Yes, I understood what you and Ying said earlier, that GeneratePress doesn’t modify the post loop. I mentioned the “home.php” thing as an explanation of why I posted here in the first place: because the first time I placed it, it didn’t override index.php, for whatever reason, so I thought GP was maybe altering normal behavior. Once it did work, I realized what you said, that it’s not a GeneratePress issue or function! Cheers! ??

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Which page file to edit to customize post loop’ is closed to new replies.