• Resolved CorpCommander

    (@corpcommander)


    Newbie plugin programmer here.

    My first plugin is a simple one. I want each post to add after the title a <DIV> that contains some meta data such as the blogger’s name. I’ve done that and it is successful. What I would like to do now, though, is to restrict that to just doing this filtering on regular blog display. I don’t want it to show up in the Dashboard list of post titles or in summaries. I think the answer is I can’t know and it would require doing it in the theme itself. However, I figure I would ask.

    Here is the code:

    [Code moderated as per the Forum Rules. Please use the pastebin]

Viewing 1 replies (of 1 total)
  • Thread Starter CorpCommander

    (@corpcommander)

    Well I did a lot of digging and came up with solutions.

    One solution focused the effect of the change on the home page by wrapping the code in “is_home” – this almost works but the “recent posts” also show the effect. I could not figure out how to isolate those out.

    I was able to modify the theme I was testing with (twentyten)and was successful by making the plugin a helper function instead of a filter. I didn’t like having to do it this way though. However modifying “loop.php” seems to be the only way to make sure it works.

    Twentyten’s “Loop” is more complex than most. Read this article to understand it better. It displays posts differently if they are in specific categories. This is a very interesting technique and I wouldn’t have known to look for it had I not seen “loop.php” first.

    The special categories aren’t automatically part of the theme, you have to add them. They are, group 1: ‘gallery’, ‘gallery category slug’, ‘twentyten’, group 2: ‘asides’, ‘asides category slug’, ‘twentyten’ and finally Group 3: is all other posts.

    What I don’t get is why the “twentyten” category is listed twice.

Viewing 1 replies (of 1 total)
  • The topic ‘Can I tell the context in which the_title() is being called?’ is closed to new replies.