Display category as link (8 posts)

  1. jumust
    Posted 2 years ago #

    I have

                            if($title) {
                                                    echo $before_title.$title.$after_title;

    it's displaying the category name. How can I show the category link instead of only the name?


  2. The snippet of code you are showing really does not provide enough context. It looks to be from a plugin ... it may be useful to link to a http://pastebin.com of the code.

  3. jumust
    Posted 2 years ago #

    Yep you are right it's from a plugin that is part of the theme I'm using.

    Here it's the pastebin of the whole file http://pastebin.com/33njxvH2

    It has as output a widget to show the last recent posts of a category you can select within the widget itself

  4. jumust
    Posted 2 years ago #

    Do you think you need any other files?

    Just let me know which functions you are looking for and I will search it through files


  5. jumust
    Posted 2 years ago #

    Hey Edward Caissie Theme Review Admin,
    did you see my pastebin? Any solution?

  6. @jumust - Sorry, I just saw you had replied.

    It appears the widget may accept multiple categories as part of its options. You will have to consider either insuring you only ever choose one category; or, write code to use a specific category (the easiest is the first category choice from the options field); then write the appropriate code to use your category choice as a link.

    Once you have sorted out the above simply wrap the $title in the category link anchor.

    Have a look at my 'BNS Featured Category' plugin for some ideas.

  7. jumust
    Posted 2 years ago #

    Thanks for your help!

    Here it is the widget, you can select one category, choose the title and number of posts shown, finally the thumbnail


    I can't handle what you suggested, too tricky for my knowledge. I don't want absolutely to use other plugin on my site because I have already a lot, but looks like this plugin will make the trick http://wordpress.org/extend/plugins/gg-widget-title-link/

  8. Yes, that widget does look like it offers you a work-around for your issue.

Topic Closed

This topic has been closed to new replies.

About this Topic