• I would like to have the slider appear at the top of every post on my Hueman site (middleweb.com). Then I’ll alter the code to have “featured posts” rotate.

    Is this a possibility without altering basic structure?

    John

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi John.

    without altering basic structure?

    Well, depends on what you mean by “basic structure”. You’ll need to edit two theme files.

    1. Copy single.php to your child theme. At the top of the file you’ll find this:

    <div class="pad group">
    
        <?php while ( have_posts() ): the_post(); ?>

    Add a line to call the featured post slider:

    <div class="pad group">
    
        <?php get_template_part('inc/featured'); ?>
    
        <?php while ( have_posts() ): the_post(); ?>

    2. Copy /inc/featured.php to /inc/featured.php in your child theme. You’ll find these two lines near the top:

    <?php if ( is_home() && !is_paged() && ( ot_get_option('featured-posts-count') =='1') ): // No slider if 1 post is featured ?>
    
    <?php elseif ( !is_paged() && ( ot_get_option('featured-posts-count') !='0') ): // Show slider if posts are not 1 or 0 ?>

    On both lines remove the is_home and is_paged criteria at the beginning of the lines:

    <?php if ( ( ot_get_option('featured-posts-count') =='1') ): // No slider if 1 post is featured ?>
    
    <?php elseif ( ( ot_get_option('featured-posts-count') !='0') ): // Show slider if posts are not 1 or 0 ?>

    The settings in the Theme Options > Blog > Featured Post options will apply to all sliders.

    Thread Starter johnnorton

    (@johnnorton)

    Thanks, bdbrown! That’s a term I borrowed from you, found in a related answer somewhere here. You said you preferred avoiding alterations to a theme’s “basic structure.” I think those were your words.

    This looks doable with a little self-instruction first. Can you suggest a ‘safe’ way to try this out, without permanently altering the site until I’m sure it works? I’ve used theme tester but I’m not sure you can test the theme you’re using while you’re using it.

    John

    Well, I don’t consider that a change to the “basic structure”. All you’ve done is insert one line of code; the theme already handles everything associated with it. Trying to change the sidebar widths is changing the basic structure. For testing I’ve always just created a subdomain off my main domain, then used the Duplicator plugin to copy the site over.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Can I have the slider appear on all Post pages?’ is closed to new replies.