function get_echo_output($index, $next = true, $args = array(), $via_filter = false) { $post_id = $this->posts[$index]; $this->load_post($post_id); $defaults = array('format' => '', 'link' => '%title', 'in_same_term' => false, 'excluded_terms' => '', 'taxonomy' => 'category'); $args = wp_parse_args($args, $defaults); extract($args); ob_start(); if ($next) { if (empty($format)) { $format = '%link »'; } if ($via_filter) { do_action('c2c_next_or_loop_post_link', $format, $link, $in_same_term, $excluded_terms, $taxonomy); } else { c2c_next_or_loop_post_link($format, $link, $in_same_term, $excluded_terms, $taxonomy); } } else { if (empty($format)) { $format = '« %link'; } if ($via_filter) { do_action('c2c_previous_or_loop_post_link', $format, $link, $in_same_term, $excluded_terms, $taxonomy); } else { c2c_previous_or_loop_post_link($format, $link, $in_same_term, $excluded_terms, $taxonomy); } } $out = ob_get_contents(); ob_end_clean(); return $out; }
/** * Display next post link that is adjacent to the current post, or if none, * then the first post in the series. * * @since 1.0 * @deprecated 2.0 Use c2c_next_or_loop_post_link() instead */ function next_or_loop_post_link($format = '%link »', $link = '%title', $in_same_term = false, $excluded_terms = '') { _deprecated_function('next_or_loop_post_link', '2.0', 'c2c_next_or_loop_post_link'); return c2c_next_or_loop_post_link($format, $link, $in_same_term, $excluded_terms); }
<div class="share top-padded"> <div class="span3"> <a href="#" onclick="window.open('https://www.facebook.com/sharer/sharer.php?u='+encodeURIComponent(location.href),'facebookshare','width=540,height=480,resizable=yes'); return false;" class="fshare" > Facebook </a> </div> <div class="span3"> <a href="#" onclick="window.open('https://plus.google.com/share?url='+encodeURIComponent(location.href),'googleshare','width=540,height=480,resizable=yes'); return false;" class="gshare"> Google</a> </div> <div class="span6 controlz"> <ul> <li class="prev"><?php c2c_previous_or_loop_post_link('%link', '<div class="prev">Producto anterior</div>', TRUE); ?> </li> <li class="next"><?php c2c_next_or_loop_post_link('%link', '<div class="next">Siguiente producto</div>', TRUE); ?> </li> </ul> </div> </div> </div> </div> <?php } } ?> </div>