• Никакой политики на форуме. Иначе - бан!
  • Вопрос без рабочей ссылки на проблему считается риторическим. Без ссылки и скриншота - провокацией!
  • Темы озаглавленные с маленькой буквы или капсом удаляются без предупреждения!

Как изменить вывод товара с ID на Артикул SKU в навигации

2008mail

Новичок
if (!function_exists('zass_post_nav')) {

/**
* Returns output for the prev / next links on posts and portfolios
*
* @param bool|type $same_category
* @param string|type $taxonomy
* @return string
* @global type $wp_version
*/
function zass_post_nav($same_category = false, $taxonomy = 'category') {
global $wp_version;
$excluded_terms = '';

$type = get_post_type(get_queried_object_id());

if (!is_singular() || is_post_type_hierarchical($type)) {
$is_hierarchical = true;
}

if (!empty($is_hierarchical)) {
return;
}

$entries = array();

if (version_compare($wp_version, '3.8', '>=')) {
$entries['prev'] = get_previous_post($same_category, $excluded_terms, $taxonomy);
$entries['next'] = get_next_post($same_category, $excluded_terms, $taxonomy);
} else {
$entries['prev'] = get_previous_post($same_category);
$entries['next'] = get_next_post($same_category);
}

$output = "";

foreach ($entries as $key => $entry) {
if (empty($entry)) {
continue;
}

$the_title = zass_generate_excerpt(get_the_title($entry->ID), 75, " ", " ", true, '', true);
$link = get_permalink($entry->ID);
$image = get_the_post_thumbnail($entry->ID, 'zass-general-small-size');

$tc1 = $tc2 = "";

$output .= "<a class='zass-post-nav zass-post-{$key} ' href='" . esc_url($link) . "' >";
$output .= " <i class='fa fa-angle-" . ($key == 'prev' ? 'left' : 'right') . "'></i>";
$output .= " <span class='entry-info-wrap'>";
$output .= " <span class='entry-info'>";
$tc1 = " <span class='entry-title'>{$the_title}</span>";
if ($image) {
$tc2 = " <span class='entry-image'>{$image}</span>";
}
$output .= $key == 'prev' ? $tc1 . $tc2 : $tc2 . $tc1;
$output .= " </span>";
$output .= " </span>";
$output .= "</a>";
}
return $output;
}

}
 
Сверху Снизу