Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1154722
    auldreekie
    Participant

    I’ve customised the content.php page in my child theme (in x-child > framework > views > icon).

    This has affected my search results page though – there’s too much information showing for each result on the page – including the page full content.

    I’d like to change the way search results appear by doing something like this:

    If search results page : show this stuff (linked title, excerpt)
    If any other page : show this stuff (title, excerpt, featured image, full content etc)

    I’ve tried various options, including is_search etc, but can’t get this to work.

    Any help gratefully received!

    #1154770
    Christopher
    Moderator

    Hi there,

    Please provide us with your site URL and the code you already have in content.php file.

    Thanks.

    #1154987
    auldreekie
    Participant
    This reply has been marked as private.
    #1155612
    Rad
    Moderator

    Hi there,

    The content.php is both used on standard post format and search result, if you just wish or intend to change the post format templates then use the condition is_search() to target proper view. Example,

    <?php
    
    // =============================================================================
    // VIEWS/ICON/CONTENT.PHP
    // -----------------------------------------------------------------------------
    // Standard post output for Icon.
    // =============================================================================
    
    ?>
    
    <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> 
    <?php if( is_search() ) : ?>
    
    original content.php's code/content here
    
    <?php else : ?>
    
    your custom code/content here
    
    <?php endif; ?>
    </article>

    Hope this helps.

  • <script> jQuery(function($){ $("#no-reply-1154722 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>