Example #1
0
 function theme_get_adjacent_post_link($format, $link, $in_same_cat = false, $excluded_categories = '', $previous = true)
 {
     if ($previous && is_attachment()) {
         $post =& get_post($GLOBALS['post']->post_parent);
     } else {
         $post = get_adjacent_post($in_same_cat, $excluded_categories, $previous);
     }
     if (!$post) {
         return;
     }
     $title = $post->post_title;
     if (empty($post->post_title)) {
         $title = $previous ? __('Previous Post', THEME_NS) : __('Next Post', THEME_NS);
     }
     $title = apply_filters('the_title', $title, $post->ID);
     $short_title = $title;
     if (theme_get_option('theme_single_navigation_trim_title')) {
         $short_title = theme_trim_long_str($title, theme_get_option('theme_single_navigation_trim_len'));
     }
     $date = mysql2date(get_option('date_format'), $post->post_date);
     $rel = $previous ? 'prev' : 'next';
     $string = '<a href="' . get_permalink($post) . '" title="' . esc_attr($title) . '" rel="' . $rel . '">';
     $link = str_replace('%title', $short_title, $link);
     $link = str_replace('%date', $date, $link);
     $link = $string . $link . '</a>';
     $format = str_replace('%link', $link, $format);
     $adjacent = $previous ? 'previous' : 'next';
     return apply_filters("{$adjacent}_post_link", $format, $link);
 }
Example #2
0
 function get_start($level)
 {
     $class = $this->active ? 'active' : '';
     $title = apply_filters('the_title', $this->title, $this->id);
     if (theme_get_option('theme_menu_trim_title')) {
         $title = theme_trim_long_str($title, theme_get_option($level == 0 ? 'theme_menu_trim_len' : 'theme_submenu_trim_len'));
     }
     return str_repeat("\t", $level + 1) . '<li' . theme_prepare_attr(array('class' => $class)) . '>' . '<a' . theme_prepare_attr($this->attr) . '>' . ($level == 0 ? '<span class="l"> </span><span class="r"> </span><span class="t">' : '') . $title . ($level == 0 ? '</span>' : '') . '</a>' . "\n";
 }
Example #3
0
 function get_start($level)
 {
     $class = theme_get_array_value($this->attr, 'class', '');
     /*jordi-ini: crear menu collapse amb bootstrap */
     $toggle_collapse = strstr($class, 'parent_menu') ? 'onclick="return false;" data-toggle="collapse" data-target=".menu-item-' . $this->id . ' > ul"' : '';
     /*jordi-fi*/
     $class = 'menu-item-' . $this->id . (strlen($class) > 0 ? ' ' : '') . $class;
     $this->attr['class'] = $this->active ? 'active' : null;
     $title = strip_tags(apply_filters('the_title', $this->title, $this->id));
     if (theme_get_option('theme_menu_trim_title')) {
         $title = theme_trim_long_str($title, theme_get_option($level == 0 ? 'theme_menu_trim_len' : 'theme_submenu_trim_len'));
     }
     return str_repeat("\t", $level + 1) . '<li' . theme_prepare_attr(array('class' => $class)) . '>' . '<a' . theme_prepare_attr($this->attr) . $toggle_collapse . '>' . $title . '</a>' . "\n";
 }
 function get_start($level)
 {
     $class = theme_get_array_value($this->attr, 'class', '');
     $class = 'menu-item-' . $this->id . (strlen($class) > 0 ? ' ' : '') . $class;
     $this->attr['class'] = $this->active ? 'active' : null;
     $title = apply_filters('the_title', $this->title, $this->id);
     if (theme_get_option('theme_menu_trim_title')) {
         $title = theme_trim_long_str(strip_tags($title), theme_get_option($level == 0 ? 'theme_menu_trim_len' : 'theme_submenu_trim_len'));
     }
     return str_repeat("\t", $level + 1) . '<li' . theme_prepare_attr(array('class' => $class)) . '>' . '<a' . theme_prepare_attr($this->attr) . '>' . $title . '</a>' . "\n";
 }