Forum Replies Created

Viewing 15 replies - 166 through 180 (of 1,478 total)
  • “the definition” refers to the place where the style is defined… that is, the bit you’re trying to change.

    whoever wrote this css is a nuffy.

    .sidebar a:link, a:visited

    is NOT the same as

    .sidebar a:link, .sidebar a:visited

    in the first example only a:link in the sidebar is affected by what follows, but a:visited everywhere is affected.

    this broken notation is dotted throughout your css.

    mind pasting the definition?

    this is a known issue with particular versions of MySQL 5… there’s no proper fix that I’m aware of (consider complaining to mysql), but you could search the forums here as it’s been dealt with in numerous threads.

    If the wordpress version you’re using is accurate, consider updating to 2.5.1

    your host may have upgraded to a bugged version of SQL 5… ask them if they have recently upgraded SQL.

    (and do what Joni said)

    So, you installed it and saw how many plugins and themes there were.
    What an in-depth review.

    I guess if I want to know if something installs, or if it’s incredibly popular, I’ll come to you. We can just forget about discussing any of those pesky “features” or comparing to other blogging platforms.

    None of that matters as long as it… installs.

    I know what maflynn was asking. I am sure you will tell me that you do too.

    Yes.

    I don’t think he was asking for anything objective

    In that case, what he wanted was completely useless information. Fan-rants are not helpful when you’re trying to make a practical decision which will affect your blogging future.

    We’re here, therefore our opinion doesn’t matter.

    It would be another story if he asked on “bloggershangout.com” which isn’t overtly and exclusively geared to any one product.

    aww 😛

    haha, I’d never seen the term ‘picnic’ used for that. Where I come from it’s PEBKAC (problem exists between keyboard and chair).

    I like picnic better, I think.

    ok… back to the single posts, and making them work regardless of how many sub-sub-cats deep your post is being categorised under.

    Lets replace the eval_post() function:

    Evaluate for Single Posts: eval_post(); – redux –

    //feed this function with get_the_category()
    //when calling it in the single post template body tag.
    function eval_post($categories) {
      global $eus_page;
      $eus_page = "Default"; // Again with the default
      //for every cat we're associated with
      foreach($categories as $category) {
        //pull the parents
        $parentcats = explode('|',get_category_parents($category->cat_ID,false,'|'));
        //remember, most important cat goes LAST in case of multiple membership
        if ($category->cat_ID==4 || $parentcats[0]=='Cat4Name') $eus_page = 'Stepping Stones';
        if ($category->cat_ID==5 || $parentcats[0]=='Cat5Name') $eus_page = 'CLC';
        if ($category->cat_ID==6 || $parentcats[0]=='Cat6Name') $eus_page = 'Community Link';
      }
      return $eus_page;
    }

    due to the relative complexity of this, and the fact that I haven’t actually put it in a page to test it… this is the least likely of all to work… so do let me know how you go, and we’ll work on making it happen. Don’t be discouraged immediately, I’m confident it’ll go.

    in the body tag of your single.php, you’ll then need to call this function as follows:

    <?php eval_post(get_the_category()); ?>

    This is to ensure that you’re passing all of the current post’s associated categories, whose parents should be discovered.

    Time for a coffee… I’ll be around working on some junk, so when you get to this, I won’t be too far off.

    It’s at this point that you ask yourself: “does he want to sleep with me?

    No, actually this is going to be useful for the next phase of a project I’ve started recently, so it’s as much for me as it is for you 🙂

    I also realised I forgot to mention – most templates open the body tag in the header.php… in order for your life to remain livable, I would suggest you don’t do that.

    Instead take the navigation/banner/bullshit components out of your header template and open the body in the *actual template you’re using to display your content*

    for example:

    <?php get_header(); ?>
    <body class="<?php eval_func($seed); ?>">
      <div id="page">
        <?php include (TEMPLATEPATH . '/navigation.php'); ?>

    note the use of the include. This lets you keep your navigation separate from each template (in a template of its own), but also separate from the header, so you can jump in-between with the glorious body tag.

    The capital TEMPLATEPATH is a bona-fide constant, not something you need to replace with your template path.

    I’m making an aside here and giving you something you didn’t ask for, because I think I can sort of predict where we’re going here…

    What about browsing category archives? surely you’ll want to be able to click on category names and view all posts in that category – in the same style as the posts themselves, right?

    Right.

    so lets deal with styling the category archive pages. As it turns out, it’s actually easier to do this with names, so I hope that’s not a problem…

    Evaluate for Category Archives: eval_cat();

    // feed me the category ID when you call me in the body tag
    function eval_cat($catid) {
      global $eus_page;
      $eus_page = "Default"; // what? you again!?
      $post = $wp_query->post; //pull $post so is_category works (again not sure if this is necessary, you find out :) )
      $categories = explode('|',get_category_parents($catid,false,'|'));
      if (is_category(4) || $categories[0]=='Cat4Name') $eus_page = 'Stepping Stones';
      if (is_category(5) || $categories[0]=='Cat5Name') $eus_page = 'CLC';
      if (is_category(6) || $categories[0]=='Cat6Name') $eus_page = 'Community Link';
      return $eus_page;
    }

    this will (and I use the term ‘will’ loosely) work when browsing top-level categories, and any children of those categories… or their children and so forth.

    So, lets say you have subcategories of Community Link called “Free booze and haggis”, you’ll be able to browse that subcategory in the same style as the commlink section.

    again.. the sidebar on your cat archive pages will be proudly brought to you by eval_sidebar() and global $eus_page.

    Which brings me back to the single posts business (remember *home alone face* ?)

    What if a post is ticked as being only in “booze and haggis”? It won’t be directly flagged as being a part of the community link section, because in_category(6) won’t trigger.

    So we need to extend eval_post() to make that work too…

    This will take a sec to cobble together, make yourself comfortable (and forgive me for any errors, as again I won’t be curteous enough to actually test this beyond the code snippits I’m stealing from my functioning blog (sorry)…

    ok, now we can deal with single posts…

    Given that single posts have their own template file, there’s absolutely no reason to complicate things by processing posts and pages in the same function… as long as we can still put our results into the sidebar, we’re golden.

    so lets think about a new function.

    Evaluate for Single Posts: eval_post();

    function eval_post() {
      global $eus_page;
      $eus_page = "Default"; // There must be a fallback
      $post = $wp_query->post; //pull $post so in_category works (not sure if necessary, but unable to test right now)
      if (in_category(4)) $eus_page = 'Stepping Stones';
      if (in_category(5)) $eus_page = 'CLC';
      if (in_category(6)) $eus_page = 'Community Link';
      return $eus_page;
    }

    just like your eval_page function, this resides inside the body tag, but only in single.php.

    This is where you can decide on a sidebar priority system. Simply decide which sidebar is more important, if by chance your post happens to be in two or more of these categories, which of course, should be discouraged.

    Whichever is the HIGHEST priority should appear at the END of the list. Does that make sense?

    but that doesn’t really deal with every possible case… you might want to put your posts in sub-categories of these categories. What then? *home alone face*

    Mind if I address that a couple of posts from now?… let me construct the meat of that first, but for a different purpose.

    remember… eval_sidebar(); is still sitting there in the sidebar template, just fishing these global $eus_page values out of the air, as required… because the body tag always happens before we get there.

    I just got back to my desk… lemme dig through a little stuff here, but in the mean time I want to suggest making a little shift in thinking…

    I think it would be a mistake to lump all this into a single function because I’m sure that would triple the necessary length of it all. Instead, lets consider breaking this up into more managable (and therefore more updatable) smaller functions.

    For example…

    Evaluate for Page Templates: eval_page();

    function eval_page($pageid) {
     global $eus_page; //global, because it's just that useful.
     $eus_page = "Default"; // Set the page type as default
     while ($pageid) {
      if ($pageid==20) $eus_page = 'CLC';
      if ($pageid==34) $eus_page = 'Community Link';
      if ($pageid==11) $eus_page = 'Recycle Scotland';
      if ($pageid==12) $eus_page = 'Stepping Stones';
      $page = get_post($pageid);
      $pageid = $page->post_parent;
     }
     return $eus_page;
    }

    I quite liked the simplicity of this, so I vote to keep it (with a little modification, which will allow us to call the right sidebar, regardless of what the hell is going on elsewhere.

    don’t worry about all that is_single stuff, lets work on that elsewhere.

    I’m gonna break this up into bite-sized posts so it’s easier to follow, so bear with me as I keep posting chunks.

    In the mean time, I propose a new function to be used in the sidebar, while the above function is used on PAGE TEMPLATES only like page.php and friends to construct the body tag.

    Because the body tag is *always* set before the sidebar is called, and because it relies on context-sensitive information like IDs etc, the bulk of the work need be done at that point. For the sidebar, we don’t want to do it again. Instead lets just grab the work we’ve already done.

    Evaluate Sidebar: eval_sidebar();

    function eval_sidebar() {
      global $eus_page;
      return $eus_page;
    }

    tada. This should be used to put the value we prepared earlier, into the dynamic sidebar. I’ll refer to this function in my next post too, bear with me. We’re still only on pages… I’ll get to single posts in just a minute.

    ahh sorry, I changed variable names, and missed a spot…..

    function eval_page($pageid) {
     $eus_page = "Default"; // Set the page type as default
     while ($pageid) {
      if ($pageid==20) $eus_page = 'CLC';
      if ($pageid==34) $eus_page = 'Community Link';
      if ($pageid==11) $eus_page = 'Recycle Scotland';
      if ($pageid==12) $eus_page = 'Stepping Stones';
      $page = get_post($pageid);
      $pageid = $page->post_parent;
     }
     return $eus_page;
    }

    I desperately need sleep, but my altered state of mind says this *should* work. I’m off to bed now, so I sincerely hope it does 🙂

    good luck, lol

    Forum: Fixing WordPress
    In reply to: got hacked

    as one moon-face to another, I implore you to reconsider any prolonged chin-abrasion 🙂

    edit: I apologise, I just realised that it’s only me who finds myself funny when I haven’t had any sleep…. and with that, I’m out 😉

    good luck with the recovery.

Viewing 15 replies - 166 through 180 (of 1,478 total)