shivika
Forum Replies Created
-
Forum: Themes and Templates
In reply to: [Pinnacle] How to make Soil plugin work with this themeI am having the same issue. Using Sage, config.php file is correct, I’m using wp_bootstrap_navwalker, and trying to get soil nav walker clean up to work. Not sure why it’s not happening. Nothing seems missing.
So I got this working by doing this:
<?php $count = get_scp_facebook(); if ($count < 1000) { echo round($count,0); } else if ($count > 1000000) { echo round($count/1000000) . 'M'; } else { echo round($count/1000) . 'K'; } ?>Did anyone figure out a way to do this. I am trying to use the filter with no success.
Thanks!
Forum: Plugins
In reply to: [WP Popular Posts] Custom category function instead of [category]I got it – it’s all in $stats. What you sent works great!! Thanks so much for your help.
Shiv
Forum: Plugins
In reply to: [WP Popular Posts] Custom category function instead of [category]Hi,
Yeah sorry – i just pasted the relevant code but it was wrapped in the whole function. The first thing I tried, actually, was just adding my function the way you did
$post_cat = ohd_get_the_category($popular->id); but that didn’t seem to work. How are you calling the category in the output? I only see title, stats, and excerpt.Thanks!
ShivForum: Plugins
In reply to: [WP Popular Posts] Custom category function instead of [category]Here it is – not so versed in backticks
Forum: Plugins
In reply to: [WP Popular Posts] Custom category function instead of [category]I forgot to backtick
// Category option checked if ($instance['stats_tag']['category']) { $child_cat = get_the_category($popular->id); $parent_cat = (isset($childcat->category_parent)) ? '<a href="' . get_category_link($parent_cat->term_id) . '">' . $parent_cat->cat_name . '</a>' : ''; if ($parent_cat != '') { $stats[] = '<span class="wpp-category">' . sprintf(__('under %s', 'wordpress-popular-posts'), $parent_cat) . '</span>'; } }Forum: Plugins
In reply to: [WP Popular Posts] Custom category function instead of [category]Hi Hector,
So I”m having a little trouble figuring out how to merge my custom category function into the custom html filter.
I’d like the category of my wpp posts to output the result of this:
function ohd_get_the_category(){ $output = ''; foreach((get_the_category()) as $childcat) { $parentcat = $childcat->category_parent; if($childcat->category_parent == 0) echo ''; else echo '<a href="' . get_category_link($parentcat) .'">' .get_cat_name($parentcat) .'</a> '; } }so I’ve been trying a whole host of variations in the filter like this;
// Category option checked if ($instance['stats_tag']['category']) { $child_cat = get_the_category($popular->id); $parent_cat = (isset($childcat->category_parent)) ? '<a>term_id) . '">' . $parent_cat->cat_name . '</a>' : ''; if ($parent_cat != '') { $stats[] = '<span class="wpp-category">' . sprintf(__('under %s', 'wordpress-popular-posts'), $parent_cat) . '</span>'; } }to no avail.
I call it in the output like this:
$output .= "<p class=\"excerpt-category\">" . $parent_cat . "<span><a href="">id ) . "\"> Read <i class=\"fa fa-long-arrow-right\"></i></a></span>";I know I’m missing something but I can’t quite figure out what. Any help would be greatly appreciated. Thanks!!
Forum: Plugins
In reply to: [Bootstrap Shortcodes for WordPress] Adding classesi found the xclass.