[Support request] Customize query for archive page

Home Forums Support [Support request] Customize query for archive page

Home Forums Support Customize query for archive page

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1265461
    Bob

    I’d like to make a slight customization to a post archive page, removing items from display if a meta value is set. Ideally, I’d like to use the existing archive template as-is otherwise. What is the best way to add this argument to the query? I was thinking that pre_get_posts would work, but I’m finding that when I put it in my archive template there is no effect.

    #1265576
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    What exactly are you trying to remove/alter?

    Let me know ๐Ÿ™‚

    #1265596
    Bob

    I have a meta field that determines whether an article appears on the homepage or not, and I’d like it to also apply to a custom post type archive page. Otherwise, I don’t need to change the standard archive template at all (I have a copy renamed with the post type name), so I’d like to somehow just add this argument to the query. For example, retrieve all articles where hide_from_home != 1.

    #1266341
    Tom
    Lead Developer
    Lead Developer
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.