Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Edward Caissie

    (@cais)

    First off, make a back-up of the plugin … just in case.

    Next, you will be looking at this line of code:
    echo $before_title . '<span class="bnsfc-cat-class-' . $cat_choice_class . '">' . $title . '</span>' . $after_title;

    The key is the $title which will need to be wrapped in an <a href=> construct along the lines of:
    <a href="<?php get_category_link( $cat_choice ); ?>">$title</a>

    The above is untested (and the reason I recommended the backup first); it will likely cause a 404 result if more than one category is used in the widget instance; and, will be over-written when version 2.0 of the plugin is released in the near future. Also to note, the entire code line will need to be re-written as the echo will no longer produce the correct results.

    I do like the idea, and will make a note to review it further for possible inclusion in future releases of the plugin, in the meantime keep track of your changes in case it is not included.

    Thread Starter frengerr

    (@frengerr)

    Thank for replying! Now the title is as link but the link in itself doesn’t work.

    echo $before_title . ‘<span class=”bnsfc-cat-class-‘ . $cat_choice_class . ‘”>“>’ . $title . ‘</span>’ . $after_title;
    }

    Am I missing something?

    Now the link goes to: mysite.com/<?php%20get_category_link(%20$cat_choice%20);%20?>

    Plugin Author Edward Caissie

    (@cais)

    Use this code as a replacement of the original echo line:

    echo $before_title . '<span class="bnsfc-cat-class-' . $cat_choice_class . '"><a href="' . get_category_link( $cat_choice ) . '">' . $title . '</a></span>' . $after_title;

    Again, the same conditions apply but this was quickly tested in a local environment and appears to work at first glance.

    Thread Starter frengerr

    (@frengerr)

    Ok, thank, fixed!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[Plugin: BNS Featured Category] How to make header title as link to category?’ is closed to new replies.