Support » Themes and Templates » Simplify » Make Featured Box images Links to Pages

  • Resolved MoeyBell

    (@moeybell)


    Thanks you for creating such a lovely template. It suits my site perfectly (Makeup Artist)

    Can you please tell me how I can make the 3 images of the featured box to be links to pages within my website? (Its not live yet so I can’t share a link)

Viewing 10 replies - 1 through 10 (of 10 total)
  • I worked it out. Within the featured-box.php I copied the code 3 times, changing the top text of each one to:

    $fboxclm = array("1");
    $fboxclm = array("2");
    $fboxclm = array("3");

    then added the link to each box instead of the #

    <a href="<?php echo of_get_option('featured-link'. $fboxn, ' LINK'); ?>">

    I hope this helps others.

    Hello, i´ve got the same problem.
    I´m not really good at php…
    How should the code look like?

    <?php
    $fboxclm = array(“1″,”2″,”3”);
    foreach ($fboxclm as $fboxn) { ?>
    <span class=”featured-box”>
    “>

    Okay, man muss von
    <?php } ?>

    bis

    </span>

    kopieren, nummerieren und dann die Links eintragen

    I was able to get it to work a little differently. The pages I wanted to link to happened to be indexed 1, 2, and 3 so I simply was able to add my link text to the loop and exit out of the quote – . add / append to the index variable and kaboom! all three links worked.

    PSYCHED!

    You need to do this:

    <?php
    		$fboxclm = array("1");
    		foreach ($fboxclm as $fboxn) { ?>
    
    		<span class="featured-box">
    			<a href="<?php bloginfo('url'); ?>/your_url/" title="<?php echo of_get_option('featured-title' . $fboxn , ''); ?>">
    				<img class="box-image" src="<?php echo of_get_option('featured-image' . $fboxn, get_template_directory_uri() . '/images/featured-image' . $fboxn . '.jpg') ?>"/>
    				<h3><?php echo of_get_option('featured-title' . $fboxn , ''); ?></h3>
    			</a>
    			<div class="content-ver-sep"></div>
    			<br />
    			<p><?php echo of_get_option('featured-description' . $fboxn , ''); ?></p>
    		</span>
    
    	<?php } ?>
    	<?php
    		$fboxclm = array("2");
    		foreach ($fboxclm as $fboxn) { ?>
    
    		<span class="featured-box">
    			<a href="<?php bloginfo('url'); ?>/your_url/" title="<?php echo of_get_option('featured-title' . $fboxn , ''); ?>">
    				<img class="box-image" src="<?php echo of_get_option('featured-image' . $fboxn, get_template_directory_uri() . '/images/featured-image' . $fboxn . '.jpg') ?>"/>
    				<h3><?php echo of_get_option('featured-title' . $fboxn , ''); ?></h3>
    			</a>
    			<div class="content-ver-sep"></div>
    			<br />
    			<p><?php echo of_get_option('featured-description' . $fboxn , ''); ?></p>
    		</span>
    
    	<?php } ?>
    	<?php
    		$fboxclm = array("3");
    		foreach ($fboxclm as $fboxn) { ?>
    
    		<span class="featured-box">
    			<a href="<?php bloginfo('url'); ?>/your_url/" title="<?php echo of_get_option('featured-title' . $fboxn , ''); ?>">
    				<img class="box-image" src="<?php echo of_get_option('featured-image' . $fboxn, get_template_directory_uri() . '/images/featured-image' . $fboxn . '.jpg') ?>"/>
    				<h3><?php echo of_get_option('featured-title' . $fboxn , ''); ?></h3>
    			</a>
    			<div class="content-ver-sep"></div>
    			<br />
    			<p><?php echo of_get_option('featured-description' . $fboxn , ''); ?></p>
    		</span>
    
    	<?php } ?>

    The header of the file goes unchanged.

    Hi there,
    the first comment was very helpful. I added LINK and it allowed me to go elsewhere. How to I actually connect that to one of my pages though? As of now all it says is “Page not found”.
    Thanks!

    Thanks very helpful. Copied the last block of php code three times and changed the links and numbers. Works great.

    Thanks BugsUsNot! I used your script and altered a little so that it still had the recent works title and standardized the height for the boxes. I was a little at a loss but this worked perfectly.

    I am brand new to WP and have little experience with CSS or PHP. I am trying to link the images on my website using the response from WPYoda, but I am still struggling to get it to work.

    I am not sure if this can just be entered into Edit CSS, or do you have to make the changes in featured-box.php?

    I am also confused on where you put the link you want it to redirect. I have tried it multiple times and just can’t get it to work.

    My site is active and I have the pages already created that I want to redirect from the featured image, so if anyone could help I would be forever thankful.

    Here is what I am trying to accomplish:

    Image 1: Redirect to http://www.benwitt.com/mortgagecenter/conventional-5-down-wo-mi/

    Image 2 & 3: Redirect to
    http://www.benwitt.com/mortgagecenter/

    Thank you!

    amecwi – I am having the same problem – have you found a solution yet?

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Make Featured Box images Links to Pages’ is closed to new replies.