Well guys, I ended up doing something like this which I am certain isn’t the best way. Seems like a lot of work just to get to the nugget. Could’ve sworn I’ve seen a simpler way but it’s escaped me all day. This is ugly and probably highly inefficient but it works. Please do let me know or point me to a better solution if you know one.
global $posts, $post;
if( is_front_page() || is_archive() ) {
$hide_pages = array();
foreach ($posts as $post) {
$hide_pages[] = ( empty( get_post_meta( $post->ID, '_prefix_hide_page', true ) ) ) ? '0' : get_post_meta( $post->ID, '_prefix_hide_page', true ) ;
}
if( in_array('1', $hide_pages, true) ) {
$hide_page="1";
}
}
Related Posts:
- How to get category and archive title?
- Get rid of WordPress category, tag and author archives?
- Category archive by year with permalink support /category/YYYY
- get_categories for custom post type with a specific custom taxonomy attached
- How To Modify The Loop in archives.php To Have 11 Posts Per Page and CSS Styling
- 404 Error On Category and Tags Pages
- Force WordPress to Show Pages Instead of Category
- Decreasing the Memory Consumption of a WordPress Site?
- What’s the URL for a category archive?
- Sort posts by tags in category pages
- How to get the category of the post and link it to the archive (of the category)
- How to hide a specific category posts in my monthly archive?
- Optimal way to redirect home page to category archive?
- Display posts links from a category group by year
- Display list of Sub-Categories and the posts they contain, within one main Category
- Sort category page with custom field
- How to create tabled index of posts in a certain category
- How would you create a “weekly” archive?
- Sticky Posts Not Sticking to Top of Category Archive
- Root level category, tag, author and archive pages to work
- Category Specific Archive
- How to have Multiple Archives Widgets, one archive widget per category (in a different page)?
- Are Custom Taxonomy Templates Possible?
- “Sticky” posts for each category (archive.php)
- I want exclude the particular category in sidebar
- How to filter archives both by category and tag?
- Remove Archive Headline and Archive Intro Text fields on category and tag archive pages in WordPress Admin with Genesis framework
- Display only posts from referred category on date archive page
- Using widget logic I want to show only a widget on the archive page if there are no posts
- What type of page should i use? static page or category page? and what’s the difference? [closed]
- Creating archive pages for children categories
- Display “add to cart” button on every listing in product category page?
- WordPress categories being called “archives” in google links. How to remove?
- functions.php conditional tag – only show in single.php?
- conditional for sub category on archive page
- Sorting posts by season
- weekly archive for custom category
- WP_Query() returns null when results exist!
- WordPress subcategories return 404 in custom template
- How to remove category titles?
- Show archives by year from just one category
- Archives for each category on WP Multisite
- Category index featured image
- Archive.php filtered by pre-determined category
- How do I call posts with a certain tag?
- Category being displayed without base parmalink
- How to change category and year archive permalinks/rewrite rules?
- How can I define a custom archive for childs of a specific category?
- Get parrent category name
- Restoring default article pagination on archives – Removing custom limits
- Category archive rewrite rule to include category/subcategory?
- add_rewrite_endpoint returns 404 on archives
- Multiple category archive page
- Custom archive.php: retrieve right post categories?
- How do I toggle pagination on/off in search results and category listings via a link?
- wp_dropdown_categories() scripts working erratically on sidebar
- Yearly Archive for Categories with dropdown
- Category archives with monthly pagination
- Customize category page for different custom taxonomies
- How to conditionally hide author name on Single.php if category is “news”, otherwise if category is something else display author name?
- Conditional IF current cat is the smallest/last/end child cat THEN
- How do I display something on a particular category page?
- Exclude a category from a query that includes its parent category
- Category archive is displaying all posts rather than the specific category
- How to Remove a Title from All Category and Tags Page?
- Problems with my conditionals in single.php by category
- Do not show sub categories in the loop on archive-product.php
- About title on a page
- why get_the_post_thumbnail( the_ID()) echos extra post id
- display category list year wise in wordpress
- Home Page Template – Specific Category
- How to display post in custom file not in archive file?
- WordPress showing wrong category name
- Media (images, videos, etc.) not showing on Category page
- WordPress monthly archive category specific
- Problem with multiple loops in wordpress theme
- Displaying year once in category.php [duplicate]
- what file I need to create to work date archive links?
- Archive filtering
- Show Secondary Sidebar on Category pages (archive)
- 2 loops in archive.php (one for each category)
- Archives and category of authors
- Search tag within category
- Category Archives: Show posts categorized in parent category only
- Determine the category that an archive-page is for
- Easiest way to display post archives in category-then-alphabetical order?
- All post of child category not in top category
- How to show monthly archive posts?
- Weird html output of single_cat_title – is not inside of the html element?
- how to implement next/prev within category archive?
- AZ Directory posts directory index
- How to link ACF relationship field to the new Query block in Full Site Editing
- Category archive page has two URLs even when default theme is active with no active plugins
- Sorting past events by month
- Sort Category Archive pages and place sticky posts first
- Category archive page redirects to home page
- Display posts on category archive organized into subcategories?
- Link from page to category posts
- Is there a standard “Archive” block that shows ALL posts from a specified category?
- Display posts in a random order for a specific category