WordPress.org

Support

Support » Plugins and Hacks » Hacks » different teasers on different groups of pages (above the loop).

different teasers on different groups of pages (above the loop).

  • hi everyone,
    iam new to php and wp so dont be too hard to me 🙂

    i want to do something like that:
    show

    i have a custom menu like
    -team
    –aTeam
    —members
    —matches
    —-bestMatch
    —-worstMatch
    —teamPhoto
    –bTeam
    —members

    -fans
    –bla
    —blub
    –and
    —so
    –on

    lets say i want to position a teasers on every of that menu entries. depending on the 1stLevel menuentry on every children the same teaser should be used. on a different 1stLevel menuentry an on every children a different teaser should be shown.
    eg: on “team” and every children like “aTeam” or “worstMatch” teaser01 should be shown
    on “fans” and every children teaser02 should be shown.

    i thought on something like this:

    // get current side id
    global $wp_query;
    $page_id = $wp_query->get_queried_object_id();
    
    // define siteids for the different menutrees
    $team_site_ids = array(IDsOfParentAndEveryChildren);
    $fans_site_ids = array(IDsOfParentAndEveryChildren);
    
    // check in which menu and display belonging teaser
    if (in_array($page_id, $team_site_ids)) {
       // load teaser02 into my div before loop
    }
    if (in_array($page_id, $fans_site_ids)) {
       // load teaser02 into my div before loop
    }

    iam sure this is not the elegant way cuz there will be to much hard coded lines and i will have more than just two menutrees. so plz give me some ideas how you would solve that and if theres a similiar plugin already availible 😉

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘different teasers on different groups of pages (above the loop).’ is closed to new replies.
Skip to toolbar