admin管理员组文章数量:1312978
In my wordpress functions.php, I have tried increasing locations position count in the breadcrumb from 2 and above in the foreach loop (while leaving out position 1 for Homepage).
Please how can I be able to achieve this? All suggestions are highly appreciated.
Below is what I tried
function zuluma_display_breadLocation($pid) {
global $zuluma_theme;
$ad_country = '';
$type = '';
$type = $zuluma_theme['cat_and_location'];
$ad_country = wp_get_object_terms($pid, array('ad_country'), array('orderby' => 'ASC'));
$all_locations = array();
foreach ($ad_country as $ad_count) {
$country_ads = get_term($ad_count);
$inc = 1;
$item = array(
'term_id' => $country_ads->term_id,
'location' => $country_ads->name
);
$all_locations[] = $item;
}
$location_html = '';
if (count($all_locations) > 0) {
$limit = count($all_locations) - 1;
for ($i = $limit; $i >= 0; $i--) {
if ($type == 'search') {
$sb_search_page = apply_filters('zuluma_language_page_id', $zuluma_theme['sb_search_page']);
$location_html .= '<li itemprop="itemListElement" itemscope itemtype=";><a href="' . get_the_permalink($sb_search_page) . '?country_id=' . $all_locations[$i]['term_id'] . '"><span itemprop="name">' . esc_html($all_locations[$i]['location']) . '</span></a><meta itemprop="position" content="$inc++;" /></li>';
} else {
$location_html .= '<li><a href="' . get_term_link($all_locations[$i]['term_id']) . '">' . esc_html($all_locations[$i]['location']) . '</a></li>, ';
}
}
}
return rtrim($location_html, ', ');
}
The below is what i got when i view the source code
<meta itemprop="position" content="$inc++;" />
本文标签: pluginsHow Can I Increase Breadcrumb Position Count (Starting From 2)
版权声明:本文标题:plugins - How Can I Increase Breadcrumb Position Count (Starting From 2)? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741876054a2402466.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论