Skip to content

Unnecessary extra query in index.php #943

@littlepackage

Description

@littlepackage

Problem:

This WP index.php included an extra WP_Query that wasn't necessary considering the Loop always puts sticky posts first by default. The code can be reduced in half and quickened quite a bit by removing that extra, unnecessary code and query.

Also the sticky posts were wrapped in an <article> with some important post information as attributes but the regular posts were not, so that was fixed as well.

Proposed Solution:

  • I have created a fix that addresses this issue. You can view it in my pull request on my fork of the repository

Steps to Reproduce (if applicable):

Extra query runs with every page load. This might also be the case for other theme files such as the archive; I haven't looked yet.

I would appreciate any feedback, and I’d be happy to work with you to incorporate the fix into the project!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions