• I’ve once again updated to the latest WordPress and still the conditionals in my sidebar do not return the expected results. is_tag does not return true in the sidebar for tag archives for instance. I’ve had this problem for many versions. It seems to occasionally get better or at least different, but it hasn’t worked completely as expected for many versions of WordPress. I’ve just lived with it.

    I put in all the conditionals up to a point and had them out put when they were true at the bottom of my sidebar. is_tag does not return true and my tag cloud does not get displayed for tag archives.

    This is a blog started in 2005 so it has been updated many, many times, most recently to the 3.2.1 code base. Besides plugins that don’t get along or function as advertise my blog is working as expected though I put a lot less work into customizing it than I used to. I’ve also taken to blogging at WordPress.com about specific topics as my blog is big and bloated and unfocused. I’d like to get the sidebar functioning as expected you can see the wacky behavior here:

    My blog

Viewing 6 replies - 1 through 6 (of 6 total)
  • I’ve not had any problems using any of the conditionals myself. Perhaps your theme is running multiple loops/queries?

    Thread Starter muskie

    (@muskie)

    This is an old problem. I wrote some code to diagnose it and prove I wasn’t insane.

    This is at the bottom of my sidebar.php:

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

    Pick any tag…

    iTunes

    It returns true for is_archive and is_date but not is_tag

    That is not the only odd case I’ve noticed, for single posts such as

    Upgraded to iOS 5 and iTunes 10.5

    This time according to the code above returns:
    is_home
    is_front_page

    Which clearly is not correct, only one page should return true for is_home and is_front_page and it shouldn’t be a random post from the 13th of October.

    Cheers,

    Are your theme’s templates running multiple loops/queries?

    Thread Starter muskie

    (@muskie)

    Not that I know of obviously. My template/theme is as old as my blog, I’ve been updating it as necessary. Finding the template/tutorial it was originally based on might not be impossible.

    I think my template is pretty logical in index.php for the theme is the following structure:

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

    I’ve had to update it so many times…

    page.php is basically unused in this blog but here it is:
    [Code moderated as per the Forum Rules. Please use the pastebin]

    archive.php is more relevant and here it is:
    [Code moderated as per the Forum Rules. Please use the pastebin]

    You’ll note in the link to the iTunes tag category archive that it says it is a tag archive meaning the call to is_tag() returns true in one column but in the column that contains the sidebar it does not return true.

    There is one comment about some hack, I don’t remember when I did this, it sounds like something I would have read about rather than randomly tried, perhaps that is a contributing factor, but I don’t understand when the page is being rendered why is_tag returns true in one place on the page and returns false elsewhere on the same page. This used to work, I’d have to go look at old posts to figure out when it got busted but I’m pretty sure I’ve complained about it previously, I know I complained on my own blog…

    Thread Starter muskie

    (@muskie)

    I had a lot of trouble going to WordPress 2.0 especially in IE but that was years ago. Going from 2.7 to WordPress 2.9.1 was a real horror story. In fact I haven’t checked my old Asian text, the WordPress upgrade may have again borked it all, but I know the fix, it is one simple line in a config file.

    I seem to have discovered a problem with Mac OS X Lion or the latest version of Disqus plugin, Asian character input.

    わかりません

    Couldn’t input that into Disqus on my blog just now, see why I strongly dislike upgrading my blogging software.

    It was during the whole sad tale of going from WordPress 2.7 to WordPress 2.9.1 and making changes recommended by experts that broke my Asian text and led to my discovery of the weirdness with conditionals in my sidebar.php file and how it renders/runs.

    I created a support thread then, never got any love or indeed any help at all.

    Thread Starter muskie

    (@muskie)

    When did the forum rules change and make posting code snippets a no no? Seems strange what with the big code button above the text entry box. I still have this problem and have had this problem since at least my upgrade to WordPress 2.7, could it be something in my database?

    But why in one column on page load does is_tag return true and in another column during the same page rendering process, does a call to is_tag return false? This behavior is consistent across any of the tags regardless of when or how I added them.

    I do use the Simple Tags plug in and bulk added some tags to old posts, but I also hand edited and tagged 100s of old posts and of course tag all my new posts using the standard tag entry box on the post edit/creation screen.

    Cheers,

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Sidebar conditional weirdnes’ is closed to new replies.