• Resolved hunink89

    (@hunink89)


    I’ve got the following working fine:

    <?php wp_list_bookmarks(‘categorize=1&category_before=

    • &category_after=
    • &before=<li class=”invinsible”>&after=’) ?>

      But now i want the next part working. Normally i could use the _$GET function, but for some reason i’m making a mistake with that. Someone help me out? What should be on the place of ‘WHAT SHOULD BE HERE’ in the following code?

      <?php
      if($_GET[‘cat’] != “”){

      echo wp_list_bookmarks(‘include=”WHAT SHOULD BE HERE?”&before=<li class=”link_total”>&after=&title_after=</h3>&title_before=<h3>&show_description=1&between=’);

      } else {

      echo ‘<p>Op deze pagina vind je bestanden die jou docent voor je op internet heeft gezet. Kies links je leerjaar. Daarna kun je kiezen voor je niveau, je klas of algemene bestanden.</p>
      <p>Lukt iets niet of heb je vragen? Neem contact op met je docent!</p>’;
      }
      ?>

Viewing 6 replies - 1 through 6 (of 6 total)
  • First of all: ubb-code doesn’t work here, you should use normal HTML (as stated below the textarea), or use the buttons above the textarea.

    ——————–

    global $wp_query;
    $cat_obj = $wp_query->get_queried_object();

    if ( is_category() ) // opgevraagde pagina is een categorie
    {
    echo wp_list_bookmarks('include='.$cat_obj->cat_ID.'&before=<li class="link_total">&after=&title_after=</h3>&title_before=<h3>&show_description=1&between=');
    }
    else // opgevraagde pagina is geen categorie
    {
    }

    Something like that should work 🙂

    Thread Starter hunink89

    (@hunink89)

    Illutic, thanks a lot, i’ve got the idea that this should work. But for some reason it doesn’t. I copied it almost exact from your post and it looks like this:

    <?php
    global $wp_query;
    $cat_obj = $wp_query->get_queried_object();
    if ( is_category(”) )
    {

    echo wp_list_bookmarks(‘include=’.$cat_obj->cat_ID.’&before=<li class=”link_total”>&after=&title_after=</h3>&title_before=<h3>&show_description=1&between=
    ‘);

    } else {

    echo ‘<p>Op deze pagina vind je bestanden die jou docent voor je op internet heeft gezet. Kies links je leerjaar. Daarna kun je kiezen voor je niveau, je klas of algemene bestanden.</p>
    <p>Lukt iets niet of heb je vragen? Neem contact op met je docent!</p>’;
    }
    ?>

    Why are you using the empty single quotes inside is_category() ??

    Thread Starter hunink89

    (@hunink89)

    I was wondering if that should solve the problem, but it doesn’t.

    If ik make this:

    global $wp_query;
    $cat_obj = $wp_query->get_queried_object_id();
    var_dump($cat_obj);

    Then the output is NULL, while it should be linkcat-16 (where 16 can be anything). So that means that something goes wrong in the frist two lines. But what? I searched some documentation on the functions bu can’t figure out.

    ok, could you mail me the complete page you’re trying to use this in? (wordpress[at]illutic[dot]nl)

    Thread Starter hunink89

    (@hunink89)

    Thanks to illutic it’s fixed now. For those who are interested here’s the code:

    <?php
    //var_dump($_GET[ ‘cat’ ]);
    $_GET[ ‘cat’ ] = substr( $_GET[ ‘cat’ ], strlen(‘linkcat-‘) ); // linkcat- wordt van $_GET[ ‘cat’ ] afgehaald en deze variabele is nu alleen een getal
    //var_dump($_GET[ ‘cat’ ]);

    if ( ( isset( $_GET[ ‘cat’ ] ) ) && ( is_numeric( $_GET[ ‘cat’ ] ) ) ) // $_GET[ ‘cat’ ] is beschikbaar en het is een getal
    {
    echo wp_list_bookmarks(‘category=’.$_GET[ ‘cat’ ].’&before=<li class=”link_total”>&after=&title_after=</h3>&title_before=<h3>&show_description=1&between=
    ‘);
    }
    else
    {
    echo ‘<p>Op deze pagina vind je bestanden die jou docent voor je op internet heeft gezet. Kies links je leerjaar. Daarna kun je kiezen voor je niveau, je klas of algemene bestanden.</p>
    <p>Lukt iets niet of heb je vragen? Neem contact op met je docent!</p>’;
    }
    ?>

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