WordPress.org

Ready to get started?Download WordPress

Forums

WP RSS Multi Importer
[resolved] Use category to distinguish items (14 posts)

  1. creeser
    Member
    Posted 1 year ago #

    My client wants to aggregate multiple fields, but still be able to differentiate the source. I think they want me to create a legend, or perhaps color code the items.

    My plan is to use categories to achieve this. For instance, if I create a "news" category, I want to add the class "news" to the output. Is there something I can use in the template to get the category of each item?

    Thank you for a great plugin!

    http://wordpress.org/extend/plugins/wp-rss-multi-importer/

  2. Allen
    Member
    Plugin Author

    Posted 1 year ago #

    How about this...can you just create a page, given it a heading that says News, then put in the feeds with the category News? If not this, how would you like the layout to be? That could be done with a template.

  3. creeser
    Member
    Posted 1 year ago #

    I worded my question really badly... let's say a have three rss categories (A, B, C). As I output the rss items, I want to echo the category they are in, so I can style them differently. For instance:

    $readable .= '<span class='.$items["category"].</span>

    But items["category"] doesn't work. Is there something else I can try?

  4. Allen
    Member
    Plugin Author

    Posted 1 year ago #

    oh..ok, if you want to put 3 categories on the same page, there are two ways to do this:

    Segregated: Have 3 headings for each category on the page with 3 shortcodes (1 for each shortcode).

    Mixed: It seems this is what you want, where they all get mixed together but there is an indicator of what category they are in. If this is what you are looking for, it's doable, but would have to be in an update as there is still some programming involved.

  5. creeser
    Member
    Posted 1 year ago #

    Yes, I'm looking for a mixed solution. I told the client it may not be possible. They will live with three heading if they have to. Thanks for looking at this for me.

  6. Allen
    Member
    Plugin Author

    Posted 1 year ago #

    ok..I'm about halfway there to getting you what you want (need to find a quick function to translate ids into names), but may have something working by the next update (end of this week).

  7. creeser
    Member
    Posted 1 year ago #

    Really? Awesome!!! Donation coming your way :-)

  8. Allen
    Member
    Plugin Author

    Posted 1 year ago #

    Thanks..ok, I have it working now...thanks for the donation. Now, since not everybody wants this, I'll have a variable that you'll need to run through a function, like this

    getCategoryName($items["mycatid"]);

    and you can use that to place and style the category like:

    $readable .= '<span class='yourclass'>'.getCategoryName($items["mycatid"]).</span>
    After I launch this let me know if you need help getting the template working and then be sure to save template (using the template panel) so it's available after future updates.

  9. Allen
    Member
    Plugin Author

    Posted 1 year ago #

    actually, if you tell me where you want this to go, I can put it there in the code and then you just need to stylize it using css...so would it be next to the source, above the title, next to the date, or where?

  10. creeser
    Member
    Posted 1 year ago #

    I've already created a custom template. I just need to know where to create the variable (which file) and how to reference it in my template.

  11. Allen
    Member
    Plugin Author

    Posted 1 year ago #

    well, at this point, what I have is:

    if ($showcategory==1){
    $catClassID='classID'.$items["mycatid"];
    $readable .= ' <span class="categoryname ' .$catClassID.'">Category: '.getCategoryName($items["mycatid"]).'</span>';
    }

    but this will require the updated version of the plugin since it relies on functions and other things. $showcategory is simply an option variable since I'll probably add this as an option. Also I have 2 classes (categoryname and $catClassID which is unique to the category.

  12. creeser
    Member
    Posted 1 year ago #

    I can wait for an updated version. My site is in development for another few weeks. Thanks again! I really appreciate it.

  13. Allen
    Member
    Plugin Author

    Posted 1 year ago #

    If you'd like, I can give you the code right now to try this out....still working on some things, but it should work for you. Let me know if you want and send a message to me by going here:

    http://www.allenweiss.com/contact

  14. Allen
    Member
    Plugin Author

    Posted 1 year ago #

    This will be an option in the next version.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.