0

I'm trying to hack a plugin to insert the category name of the post above the post title in a plugin/widget that displays three posts in a single row on the front page.

The hack I tried is as follows, but while it worked on localhost it did not work on my live installation - this is the hack I tried to be added at functions.php:

$count = 1;

function custom_cat_before_featured_page_title($tc_fp_title_block , $featured_page_title = '' ){
$o = get_option('tc_pro_fpu');

global $count;

if($count == 1){
$value = 'one';
}
if($count == 2){
$value = 'two';
}
if($count == 3){
$value = 'three';
}
$value = $count;

@$id = $o["tc_featured_page_{$value}"];
@$categories = get_the_category_list( ", ", "", $id );
$cat = '';
if(!empty($categories)){
$cat = ' <div class="customizr-fpc-category">' . $categories . '</div>';
}

$count++;
return $cat.$tc_fp_title_block;
}
add_filter( 'fpc_title_block', 'custom_cat_before_featured_page_title' );

The files related to the plugin/widget in the theme are as follows:

http://pastebin.com/X210VebN and http://pastebin.com/Q7ugkAJr

I appreciate all help!

1 Answer 1

0

Try removing $value = $count, you are first setting it as a string which I assume is correct to get the option value - but then straight away undoing what you've done by setting it back to $count (numerical.)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.