WordPress.org

Ready to get started?Download WordPress

Forums

Include Category count within href tag (9 posts)

  1. verburgs
    Member
    Posted 9 years ago #

    I posted about this a few days ago, but now have somewhat of a fuctional page that validates to look at it.
    I am trying to include the post count withing the category href. The way I have my links setup as a block, it kicks the count down to a second line. I need to find out how to get it on the smae line and I think the easiest way to maintain my style, is to include it in the link. Can anyone tell me what and where I need to edit to get this fixed? You can see exactly what I am refering to if you view the Category section on this page:
    http://www.theverburgs.com/blog/
    WARNING - If you click a link to view an article or comment, the page will be severly distorted. I am new to css and WP and am working on setting it all up.
    Thanks,
    Jay

  2. verburgs
    Member
    Posted 9 years ago #

    Anyone?

  3. Joshua Sigar
    Member
    Posted 9 years ago #

    I couldn't think of another way than including the count in the link like you said. The function to hack is in wp-includes/template-function-category.php
    The function is list_cats. Copy that function to my-hacks.php rename the function name e.g. my-list-cats and then do the modification. Then call that modified function from your index.php

  4. verburgs
    Member
    Posted 9 years ago #

    alphaoide, thanks for checking it out. I have no problem including it in the href tag as I think that is the only way around my problem.
    Sorry, I am completely new to PHP. I found the wp-includes/template-function-category.php, but as for list_cats, it is all over the page. I'm not sure which one to edit, or even if there is already a tag I can copy into somewhere. I couldn't find my-hacks.php and wasn't sure if that was a file I needed to create. also I am unsure as to what you mean when you say "do the modification". I was hoping it would be as simple as copying a tag and pasting into where it writes the

  5. item.
    Thanks for looking at this,
    Jay

  • Joshua Sigar
    Member
    Posted 9 years ago #

    I could modify it for you and have you download it. But I might have no time until tomorrow. In the meantime ditch the post count and work on something else, would you.

  • verburgs
    Member
    Posted 9 years ago #

    alphaoide,
    I hate for you to just do it for me, that wasn't my intent. That is very kind of you. As you probably noticed, I have plenty to work on with the site.
    I did find refernce to the my-hacks.php with the option of "Use legacy my-hacks.php file support" under Miscellaneous. I am using 1.3-alpha-5, not sure if that is why it is considered "legacy".
    Thanks for you time,
    Jay

  • verburgs
    Member
    Posted 9 years ago #

    OK, it's amazing what a little reading will turn up when you are provided a hint.
    I found most of the information regarding my-hacks.php in the wiki. Now I'm not sure exactly which files need to go there, but at least I got my my-hacks.php file created and in place.

  • verburgs
    Member
    Posted 9 years ago #

    Wow. Already have it implimented. I can't thank you enough for your help. I plan to dig around your post to learn a little more.
    Thanks for everything.
    Jay

  • zurdog
    Member
    Posted 9 years ago #

    Can you post the solution to this?

  • Topic Closed

    This topic has been closed to new replies.

    About this Topic

    Tags

    No tags yet.