SimpleFolio Customization: Use custom field to control homepage slider links

February 20th, 2011 Posted by Public 13 comments on “SimpleFolio Customization: Use custom field to control homepage slider links”

Follow the steps below to change the behavior of SimpleFolio on the home page to link wherever you want instead of the single post page.

Start by adding a custom field to your post called “link”

Next, modify the “template_home.php” file located at /<root>/wp-content/theme/simpifolio

Find the following on Line 21:


$thumb = get_post_meta($post->ID, 'thumb-large', true);

Add this:


$link = get_post_meta($post->ID, 'Link', true);

Find this on line 24:


<li>
<a href="<?php the_permalink(); ?>"><img src="<?php echo $thumb; ?>" alt="<?php the_title() ?>" /></a>
<span><h3><?php the_title() ?></h3> <?php the_content_limit($text_count, ''); ?></span>
</li>

Replace with this:


<li>
<a href="<?php echo $link; ?>"><img src="<?php echo $thumb; ?>" alt="<?php the_title() ?>" /></a>
<span><h3><?php the_title() ?></h3> <?php the_content_limit($text_count, ''); ?></span>
</li>

Now you can create a post for the homepage slider and can direct users to any page you wish, just change the value in the “Link” custom field.

Tags: ,