Forums

[resolved] Differentiating Posts and Pages in the Search Results Page (4 posts)

  1. Reservoir Dog
    Member
    Posted 1 year ago #

    It is brief: what function can one use to differentiate between regular posts and occasional pages in search results? I need to treat them differently.

    Apologies if it's been asked before.

  2. Jarret Cade
    Member
    Posted 1 year ago #

    What exactly do you mean?

    Do you mean if you do a search on your WordPress site and it returns the results being both posts and pages you want to differentiate between the two on the search results page?

  3. Reservoir Dog
    Member
    Posted 1 year ago #

    Yep.

  4. Reservoir Dog
    Member
    Posted 1 year ago #

    Never mind. get_post_type() actually suffices.

Topic Closed

This topic has been closed to new replies.

About this Topic