• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

WP SITES

2784

Original Genesis Tutorials & 6000+ Guaranteed Code

Snippets

  • Consultation
  • Full Access
  • Log in

pre_get_posts

The pre_get_posts hook enables you to modify whats included in any archive page type loop before it runs making it one of the most efficient ways to alter any original query before WP_Query has been set up.

Show Sticky Posts Only On Front Page

Assuming your home page reading settings are configured to display your latest posts in a paginated archive rather than a static page, you

pre_get_posts

Only Show Specific Pages or Posts On Home Page

This code enables you to select which single pages you want displayed on the front page of your WordPress site. It excludes all posts and

pre_get_posts

Include Single Pages With Posts In Home Page Loop

This code laters the main query for the home page loop to include single pages with posts. Add the PHP code to the end of your child

pre_get_posts

Set Posts Per Page For Any Archive Type

Use this code in your child themes functions file with a conditional tag to target a specific archive page type to set posts per

pre_get_posts

Return Search Results After A Specific Date

If you want to exclude older posts from your search results, you can using pre_get_posts. The following code uses the date_query from

pre_get_posts

Add Custom Field To Genesis Loop

This code enables you to add custom field content like text, HTML & images to the Genesis loop. You can use the code 2 ways: The

Custom Fields pre_get_posts

Genesis Search Results Template You Can Fully Customize

This template for Genesis, enables you to customize how the search results are displayed on the search results page. The template includes

pre_get_posts

Minimum Pro – Change Portfolio Archive Entries To 3 or 4 Columns

By default, the Minimum Pro child theme by StudioPress is coded to display the portfolio archive entries in 2 columns like this: This

Minimum Pro Theme post_class pre_get_posts

Set Posts Per Page For Tag Archive

This code enables you to set the posts per page limit for any tag archive page. This way you can over ride the WordPress > Reading settings

pre_get_posts

Exclude From Genesis Blog Page Template

This code enables you to exclude single posts & pages as well as posts in different types of archives like author, category, search, and tag

Blog Page pre_get_posts

Set Different Amount of Posts Per Page For Each Archive

This code enables you to set a different amount of posts per archive page, otherwise use the default WordPress Reading settings. The

pre_get_posts

Exclude Latest Post From Home Page Loop

In this tutorial. i'll provide the code i tested which excludes the latest published post from your home page loop. Simply copy this PHP

pre_get_posts

3 Ways To Remove or Exclude Posts From Your Home Page Loop

There's at least 3 ways you can exclude one or more single posts from your home or posts page depending on your Reading Settings. You

pre_get_posts

Add Custom Post Type (CPT) Pages To Posts Page

By default, only posts are displayed on your posts page which can either be your home page or blog page depending on your Reading

Custom Post Type pre_get_posts

Customize Archive Pages Conditionally Using Pre Get Posts

In this tutorial, i'll give you several PHP code snippets i have tested locally which enable you to customize how your posts are displayed

pre_get_posts

3 Ways To Display Posts In One Category On Front Page of Genesis

This is a beginners guide to setting up what posts display on the front page of your site. If you only want to display posts from one

pre_get_posts

Primary Sidebar

Code written by Brad Dalton specialist for Genesis, WooCommerce & WordPress theme customization. Read More…

Advertise · WPEngine · Genesis · Log in

  • Access Problems
  • Account Details
  • Consulting
  • Tags
 

Loading Comments...
 

You must be logged in to post a comment.