bbPress Forum

Premium theme support service has been moved to http://colorlabsproject.com. If you are a premium theme user, please send an email to sales [at] colorlabsproject [dot] com and ask for an access to the new site. Please mention a username and password that you want and please include your PayPal email used for the transaction.

All customers that purchased the theme before January 1, 2009 have to send us an email so that they can get the access. This forum will no longer support premium themes and will only support Arthemia Free and Linoluna Theme. This new all-in-one support system will enable you to download the latest version of the theme, browse for online documentation, and ask for theme support.

We value all of our customers and we can't wait to see you there. Thank you!

Jubel and The Unessentials - Forum » Arthemia Free

the most *fascinating* bug - code loop, or just moving incorrectly?

(12 posts)
  • Started 1 year ago by daveyola
  • Latest reply from hbschiller
  1. daveyola
    Member

    first of all, i just want to say thank you for releasing such an incredible theme! i'm tinkering with the free version to see how it works for my site, modified tons of stuff very easily, planning to upgrade to your premium version provided my site gets *at least* a tiny bit of traffic ;)

    ...but the most unusual bug has appeared and it is simply beyond me. here's the summary:

    i've attempted to copy the code for the category bar into the top of post and page and archive (single and page and archive.php respectively) - but once i do this, every single link on the entire site redirects to the exact same (randomly selected) url/permalink. what i mean is that nothing crashes, nothing breaks, but rather you click on *any* article/page/category link on the site and the "permalink" in url bar is just fine, but the actual page displayed is a randomly selected post - and that same exact post appears for 100% of all links - any thoughts? here's the precised code that i'm pasting, which is exactly what you've written - unmodified - and pasting into header.php (and also tried below header in page.php, single.php etc, but same thing happens every time!!!)


    <div id="middle" class="clearfloat">
    <h3>browse categories >> </h3>
    <?php $display_categories = array(12,6,7,8,9); $i = 1;
    foreach ($display_categories as $category) { ?>

    <div id="cat-<?php echo $i; ?>" class="category">
    <?php query_posts("showposts=1&cat=$category")?>
    <span class="cat_title">"><?php single_cat_title(); ?></span>
    "><?php echo category_description($category); ?>
    </div>

    <?php $i++; ?>
    <?php } ?>

    </div>

    ...should some element of this be removed to prevent infinite references to a single post? and how on earth is that random post selected for all redirects! so strange...confounding...any insight appreciated

    Posted 1 year ago #
  2. what about:
    <?php wp_reset_query(); ?>
    before the div tag after the foreach loop?

    Posted 1 year ago #
  3. hi there.

    well, first of all, it's not a BUG, as you are using the theme beyond how we design it. :) and that's not odd, though, because that's how Wordpress deal with post query and database and all those stuffs can't be accomplished only with moving and pasting codes.

    and I bet that the single link that you have all over your blog is the link for a post that comes from the last category displayed in the category bar, isn't it?? see? that's not weird at all. that's just how WP query works. :)

    don't forget to do Joern's solution. That should do it.

    Posted 1 year ago #
  4. daveyola
    Member

    no luck, tried inserting before the div tag (in that open space) after the ?> closing for the foreach and it's still doing it...

    Posted 1 year ago #
  5. you have to add the code at the very end. after the last </div>. one can reset a query after a query happens. and at the point you've pasted the code (@above msg), there has been no query yet.

    Joern mentioned that you need to add the command after the foreach loop and the loop ends after the last bracket. the "foreach" command is the beginning of the loop and the end of the loop is ended with a bracket ( } ).

    Posted 1 year ago #
  6. daveyola
    Member

    yes, it is now showing up visually - thank you...though something very odd in a format item:

    now before each category name, and after, it adds characters so instead of:

    categoryname

    it is:

    ">categoryname">

    ...and so while the css is applied and it looks visually correct, the categories themselves do not actually "link" to anything (they're just mouseover/hover effects with no 'click' ;)

    ? any idea where it pulls those characters? there is no formatting applied...

    Posted 1 year ago #
  7. daveyola, you gave us earlier a part of index.php and there I can clearly see before and after this:
    <?php single_cat_title(); ?></span>
    the strange characters you talk about "> ">.
    In this forum here, even if you mark as code, the 'a href' and 'a' will not be displayed...
    There is the linking part to the cat_title, the 'a' around, missing.
    copy it from original index.php to your file, not out of the forum

    Posted 1 year ago #
  8. daveyola
    Member

    thank you sooo much!! i realized that as reading your reply - the a href= didn't appear, and i remembered that i did a quick cut and paste from here and not the original index.php

    it's working great now! thanks!

    Posted 1 year ago #
  9. daveyola
    Member

    btw, a random question - do you think that resetting the query like this will eventually lead to seriously slow site issues? i'm basically saying, "hey, don't ever cache this query or if you do, then reset it on every (page or where it appears at top) load" - could that, for example, constantly flush a supercache plugin cache set when pages are reloaded? or will wp-cache's own cache (or supercache) know enough to isolate the 'category bar query'

    just a curious aside, wondering if you have any thoughts on it...

    personally, i found my site going faster when i turned supercache *off* -go figure!

    Posted 1 year ago #
  10. i am not so deep in that stuff, I would guess it will for sure not slow down your site. Some themes have this line after each query to start a clean new one. Check the wordpress forum for that...
    Imho it will not make supercache flush anything, I never tried that though.

    Posted 1 year ago #
  11. This usually depends on the settings of your mysql server. The page loads faster if it's better configured :)

    Posted 1 year ago #
  12. hbschiller
    Member

    worked !!! thanks!!!

    Posted 11 months ago #

RSS feed for this topic

Reply

You must log in to post.

Proudly Powered by bbPress.