Support » Themes and Templates » RSS feed_image on the *left*?

  • Resolved parakeet

    (@parakeet)


    Does anyone know how to get feed_image to appear on the *left* (as opposed to the right) of a category title link?

    I’ve tinkered with CSS and the code in template-functions-category.php – all to no avail.

    Anyone have any tips/plugins/code please?

Viewing 15 replies - 1 through 15 (of 16 total)
  • more information is needed, like a link to your example site.

    is the image done in CSS? Or is it linked as an image in the html?

    http://www.blogwales.com/2006/09/04/matt-marshall-strikes-out-to-launch-venturebeat/

    It’s accomplished using the following code…


    <h3>Categories</h3>

      <?php wp_list_cats('sort_column=name&optioncount=1&exclude=10,15,2,75&feed_image=/wp-content/themes/minid/images/rss/feed-icon-10x10.gif'); ?>

    … That is, stating the feed_image parameter when calling wp_list_cats

    Thanks

    ok, gotcha.

    that needs a modification to the wp-list-cats function. hmm, has there been a plugin that overrides that? I’ve tried shoving them around with css, but couldn’t quite get there.

    how do you feel about modifying your core wordpress files?

    another option might be to duplicate the function, give it a different name, customize that one, and then use it instead. maybe you can put it in your theme’s functions.php file. Are you up for that sort of task? This would give you an upgrade friendly, theme specific change.

    Or what if you just right justified the whole list in css? You’d get a neater list, if the ragged appear of the icons is what is bothering you.

    Definitely prepared to modify code; just not certain how. In template-functions-category.php, I found the portion in which feed_image is processed, cut it and inserted it above the portion where the category title link is generated – but that doesn’t work.

    A plugin would be ideal but I haven’t been able to find one, surprisingly.

    I tried floating the image left, but it staggers the whole list.

    Not certain about duplicating the function. Do you mean moving the relevant parts from template-functions-category.php to functions.php? Would still have to be modified, right?

    Right-aligning everything could be a last resort; good thinking.

    I did come across a modified template .phps someone hacked back in 2004 but it won’t work at all, presumably because the core files are substantially different from pre-2.0 WP.

    Hmmmm :/

    Thankws

    If you found the function, that’s the first step. I’m not a fan of modifying core files, but I’ve never replace a function before, so this is all I can advise.

    Inside list_cats, immediately after $num_found++;, put this:

    $link = ''; //note this is two single quotes

    Then move everything from
    if ( (! empty($feed_image)) || (! empty($feed)) ) {
    to it’s closing } to right after our new $link = ''; statement.

    Then change this (should be the very next thing after our additions):
    $link = '<a href="'.get_category_link($category->cat_ID).'" ';

    to
    $link .= '<a href="'.get_category_link($category->cat_ID).'" ';

    (the only change is a . before the =

    If it borks, just replace the file with your backup, and we’ll try again. Hopefully you’ll have what you want. This is modifying a core file though, so it will break during an upgrade. If someone else can advise how to replace this function with a plugin, then great.

    You could put this in your stylesheet:

    div.principal li a img {float:left;margin-top:-13px;}
    div.principal li a {clear:left;padding-left:13px;}

    However, if the link is more than one line long (see “Usability and User Experience”) it’ll look funky. But it works…

    i tried doing something like that doodlebee, but I couldn’t quite get it. You’ve gotten closer than I did, but it still cocks up in a couple of places like you said. Perhaps if he could shorten some of his category names.

    whooami

    (@whooami)

    Member

    you want this?

    http://www.somesite.org/test-install/

    I did that on an older install, some time ago. Making it work in 2.0.4 wasnt much harder since I backup files. I can post the code for you that you need to change inside template-functions-category.php OR i can pluginize it.

    Up to you, its a fair amount of edits, and I really dont want to post a ton of code to this thread.

    In fact, I prefer this but due to my nifty category menu on my live site cant have it that way right now.

    I would prefer if you would pluginize, so I can look to see how you do that. I’ve not done anything like this yet, so I would appreciate it as a learning experience. no problem if you’d rather not.

    whooami

    (@whooami)

    Member

    I wonder, if I would need to duplicate that whole list_cats function, prolly so.

    *holler when you want that link broken….* and yeah, I think you’d have to dupe the whole function.

    whooami

    (@whooami)

    Member

    damn that was a bit of work to get that nested list stuff to validate, i detest nested lists but it looks like it does work (atleast with kubric).

    This wont take long.

    whooami

    (@whooami)

    Member

    done, see http://wordpress.org/support/topic/86040?replies=1#post-439240

    and if someone would break that url above, I would be most overjoyed.

    thanks!!

    Okay, some real progress here.

    * Thanks to manstraw. You suggested modifications to the core file work a treat. I was oh so close to having that sort of tweak nailed before I had to seek help; you got me there.

    * Thanks to whooami for making the plugin version. This way, I guess I’m able to reproduce the effect but leave the core files in tact. Excellent.

    Thanks, all. A useful contribution and addition to the plugin base, I’m sure.

    Done, whoo….

Viewing 15 replies - 1 through 15 (of 16 total)
  • The topic ‘RSS feed_image on the *left*?’ is closed to new replies.