Blogs MU theme - Feature Settings option - want an image slider

I'm working with the Blogs MU theme. This is the first time I've used a WPMUdev theme. I'm loving the options for customizing the theme!

But I'm stuck on the feature image for the home page. I'm in "Blogs MU Theme Options" > "Features Settings".

For the "Preferred intro block style" I want to have an image slider, showing a range of images. These images are not for different posts. Just profiling a gallery of photos.

I can't find how to do this. The only options I seem to have is one static image ("Image intro" in the drop down), or the sliders are for either posts or categories. Which isn't what I'm wanting.

Can you please tell me how to get this theme to have a standard image slider on the home page? I don't mind jumping into code to make it work.

Thanks
Josh

  • EnzoMDD

    Hey @Josh,

    If you set Featured Settings > Featured Slider Category's, and then edit this file:

    wp-content\themes\blogs-mu\lib\templates\wp-template\feat-cat.php

    Replace all the contents with this:

    <div id="slider-wrapper">
    	<div id="slider" class="nivoSlider">
    
    		<a href="http://placehold.it/">
    			<img
    				title="Test post 18"
    				width="600" height="auto"
    				src="http://placehold.it/500x500"
    				class="feat-post-thumbnail full feat-thumb"
    				alt=""
    			/>
    		</a>
    
    		<a href="http://placehold.it/">
    			<img
    				title="Test post 18"
    				width="600" height="auto"
    				src="http://placehold.it/501x500"
    				class="feat-post-thumbnail full feat-thumb"
    				alt=""
    			/>
    		</a>
    
    		<a href="http://placehold.it/">
    			<img
    				title="Test post 18"
    				width="600" height="auto"
    				src="http://placehold.it/502x500"
    				class="feat-post-thumbnail full feat-thumb"
    				alt=""
    			/>
    		</a>
    
    	</div>
    </div>

    Change the "img" src URLs to those of your images (you can find the URLs of uploaded images through your WordPress media explorer).

    Place any changes to theme files into a child theme, as when you update the theme the file will be reverted to its original. See http://codex.wordpress.org/Child_Themes.

  • Josh

    Thanks so much for your specific instructions and code. It was perfect! I also really appreciate the guidance about setting up a Child Theme for all adjustments.

    I ended up modifying the code so that the image slider automatically shows all images included in a specific directory on the server. This way whenever I want to add a new image to the home page slider, I just upload it to that directory. (Although this wouldn't work for people who want titles and unique hyperlinks on each image).

    I'll paste the code here, in case it is useful to anyone else.

    Set up a child theme of BlogsMU (or whichever theme you're running nivoSlider on).

    Copy this file to your child theme:
    wp-content\themes\blogs-mu\lib\templates\wp-template\feat-cat.php

    Replace the full contents of the file with this:

    <div id="slider-wrapper">
    	<div id="slider" class="nivoSlider">
    
    <?php
    foreach (glob("wp-content/uploads/homepage_images/*.{jpg,png,gif}", GLOB_BRACE) as $filename) { ?>
    	<img src="<?php echo $filename ?>" alt="" width="420" height="280" class="feat-post-thumbnail full feat-thumb" title=""/>
    <?php
    }
    ?>	
    
    	</div>
    </div>

    Now create a folder called "homepage_images" in the uploads folder. Put images in there and in your theme options under "Feature Settings" choose "Featured Slider Categories".

    Important note: The title="" in the image tag is essential! It took me ages to work out that nivoSlider doesn't work if there is no title tag in the image.

    Again, thanks for all your help.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.