• 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

Show Custom Field Value And Or Content For CPT And Standard Post Types In Search Results

This download folder contains 3 different code snippets.

The code customizes the search results enabling you to return the custom field value and/or content for single posts and/or specific custom post types.

Snippet 1 – Returns CPT custom field value & the content for portfolio and property CPT’s only. Excludes standard posts. Here’s a actual result :

Returns CPT custom field value & the content for portfolio and property CPT's only. Excludes standard posts

Snippet 2 – Returns CPT & Post custom field values & the content for posts and portfolio CPT only. Excludes other CPT’s. Here’s a actual result :

Returns CPT & Post custom field value & the content for posts and portfolio CPT only

Snippet 3 – Returns CPT & Post custom field values & the content for posts and 2 different CPT’s. Here’s the actual result :

Returns CPT custom field values & the content for posts and 2 different CPT's

Demo Video #

Shows the result generated by the the 3rd code snippet returning search results for the CPT custom field values & the content for posts and 2 different CPT’s.

Tested using the Genesis Sample child theme by StudioPress. Works in any Genesis child theme and any WordPress parent or child theme.

Code Installation – From Download Folder #

There’s only 1 step :

Copy one of the code snippets to the end of your child themes functions.php file and modify the code to match the name of your posts types. Example :

Register for full access

Related Tutorials

  • Show The Content Limit And Custom Field Value For Specific Post Types In Search Results
  • Use Custom Field Content For A Custom Post Type In Genesis Search Results

Custom Fields Custom Post Type Search

Reader Interactions

Leave a Reply Cancel reply

You must be logged in to post a comment.

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.