WordPress.org

Ready to get started?Download WordPress

Forums

Ugly title parsing in K2 RSS Sidebar Module (2 posts)

  1. Fadookie
    Member
    Posted 7 years ago #

    Hey all, I've been having a problem with my RSS sidebar module. This does pertain specifically to a K2 module, but I think it's really more of a general WordPress/PHP question.

    The RSS module grabs my Google Reader feed with fetch_rss and runs it through some formatting to create a list of links. My issue is that in my Google Reader feed, the <title> attribute occurs twice for each <entry>. Here is a simple diagram of the structure:

    <entry>
      <title>Post title</title>
      <source>
        <title>Blogname</title>
      </source>
    </entry>

    The problem with the current formatting code is that it just throws the two titles together, creating links that look like "Post titleBlogname". I'd like to have them look more like "Post title - Blogname". It would also be cool to use the <link> given in the <source> block to link the Blogname to the Blog's URL, but this is not neccessary by any means.

    I have pasted the RSS Module's code for easy inspection. Please see my blog for an example of this in action- look for the "Google Reader highlights" in the sidebar.

    Does anyone have an idea of how I should go about adding the proper delimiters between the two titles? I am obviously not much of a PHP coder, so any help would be appreciated.

    WordPress 2.1.2 & K2 0.95 RC1

  2. gfa202
    Member
    Posted 6 years ago #

    this parsing problem still exists in wp 2.3.3

Topic Closed

This topic has been closed to new replies.

About this Topic