Advertisement
wilcochris

Slider target option

Jun 19th, 2012
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.45 KB | None | 0 0
  1. /* mantra-admin-functions.php */
  2. /* Code to have an option to target link to a blank page or same page */
  3.  
  4. /* Slide option*/
  5. <p>
  6. <b><?php _e("Target","mantra");?></b>
  7. <?php
  8.     $items = array ("_blank" , "_self");
  9.     $itemsare = array( __("Blank","mantra"), __("Self","mantra"));
  10.     echo "<select id='mantra_slidertarget1' name='ma_options[mantra_slidertarget1]'>";
  11.     foreach($items as $id=>$item) {
  12.     echo "<option value='$item'";
  13.     selected($mantra_options['mantra_slidertarget1'],$item);
  14.     echo ">$itemsare[$id]</option>";
  15. }
  16. echo "</select>";  
  17. echo "<br/><small>".__("Blank opens in a new page. Self opens in the same page","mantra")."</small>";  
  18. ?>
  19.  
  20. /* Column option */
  21.  <p>
  22. <b><?php _e("Target","mantra");?></b>
  23. <?php
  24.     $items = array ("_blank" , "_self");
  25.     $itemsare = array( __("Blank","mantra"), __("Self","mantra"));
  26.     echo "<select id='mantra_columntarget1' name='ma_options[mantra_columntarget1]'>";
  27.     foreach($items as $id=>$item) {
  28.     echo "<option value='$item'";
  29.     selected($mantra_options['mantra_columntarget1'],$item);
  30.     echo ">$itemsare[$id]</option>";
  31. }
  32. echo "</select>";  
  33. echo "<br/><small>".__("Blank opens in a new page. Self opens in the same page","mantra")."</small>";  
  34. ?>
  35.  
  36. /*front-page.php */
  37. /* Slide & Column showing the target inherited from options */
  38. <a href="<?php echo $mantra_sliderlink1 ?>" target="<?php echo $mantra_slidertarget1; ?>">
  39. <a href="<?php echo $mantra_columnlink1 ?>" target="<?php echo $mantra_columntarget1; ?>">
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement