• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Adding EME events to search

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › General Discussion › Adding EME events to search

This topic is: not resolved

Tagged: events made easy, php, search

  • This topic has 4 replies, 2 voices, and was last updated 7 years, 9 months ago by Robert Falkowitz.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • May 12, 2018 at 8:07 am #219799
    Robert Falkowitz
    Participant

    Am using the Infinity Pro theme and an event management plugin named "Events Made Easy" (EME). Since that plugin does not use the same table as posts to store the events, events do not appear in the standard search functionality.

    However, the plugin gives the following advice on how to add its events to search:

    So, create a child theme and edit search.php there.
    At the beginning of search.php, add this line:

    $events = eme_wordpress_search_events();

    In EME before version 1.7.11, this is called just eme_wordpress_search() and will be available as backwards compatibility function call.
    Further down in search.php, change:

    <?php if ( have_posts() ) : ?>

    to:

    <?php if ( have_posts() || !empty($events) ) : ?>

    And then, just above the call for (or wherever you want it), add something like this:

    <?php foreach ($events as $event) {
       print "<h2><a href='".eme_event_url($event)."'>".$event['event_name']."</a> ".$event['event_start_date']."</h2>";
       print substr($event['event_notes'],0,250)."[...]";
       print "<div style='clear:both;'></div>";
    } ?>

    This advice does not look remotely like what I can find in Genesis/Infinity Pro, so I wonder if someone has already done this in a Genesis theme and can indicate how to adapt the instructions accordingly.

    Thanks!

    May 12, 2018 at 11:11 am #219808
    Brad Dalton
    Participant

    This might help https://wpsites.net/web-design/custom-fields-on-search-results-page/

    You'll need to integrate your code however its a step in the right direction.


    Tutorials for StudioPress Themes.

    May 13, 2018 at 2:53 am #219812
    Robert Falkowitz
    Participant

    Thanks for this, Brad. I don't think the logic of those solutions, based on checking custom fields with the post table, will apply to my case.
    Still looking...

    May 13, 2018 at 5:26 am #219815
    Brad Dalton
    Participant

    I meant creating a custom search.php file.

    And then hooking in your code using the genesis_entry_content hook.

    Remove the part for the custom fields and replace it with your code like this :

    add_action( 'genesis_entry_content', 'search_page', 12 );
    function search_page() {
    
    // Add your code here
        
        }
    

    Tutorials for StudioPress Themes.

    May 13, 2018 at 9:56 am #219824
    Robert Falkowitz
    Participant

    The problem is in getting the output concerning the matching events to appear only once, on the last page of the output, but before the bit at the bottom of the page that allows the visitor to select the page of output to which to jump.

    For example, if there are 6 pages of output for a search and you are on the 6th page, here is what I would like to display:

    <the last post/page should appear here>

    <the list of matching events should appear here>

    <and then finally, the page selector options, such as:>

    « Previous Page Page 1 Page 2 Page 3 Page 4 … Page 6 Next Page »

    With all the hooks I tried (genesis_entry_content, genesis_after_loop, genesis_before_loop), either the output for the matching events appears on every page, or after the page selector options.

    Is there a hook that does what I want, or do I have to build the logic into the search.php that calculates how many pages of output there will be and then displays the event output only on the last page, using the genesis_entry_content hook?

  • Author
    Posts
Viewing 5 posts - 1 through 5 (of 5 total)
  • The forum ‘General Discussion’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2026 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble