Forums

WP-Cumulus for Static Pages (4 posts)

  1. glar
    Member
    Posted 1 year ago #

    Hello,

    I've tweaked wp-cumulus.php in order to display only static pages in the cloud as a fancy menu. In the widget setup page one has to choose "Categories".

    Here are the changes:

    // get categories
    if( $options['mode'] != "tags" ){
    ob_start();
    //wp_list_categories('title_li=&show_count=1&hierarchical=0&style=none');
    $mypages=wp_list_pages('echo=0&title_li=&depth=-1');
    $pagearray=explode('<li',$mypages);
    for ($i=1;$i<count($pagearray);$i++) {
    $z=$pagearray[$i];
    $pos=strpos($z,"<a");
    $z=substr($z,$pos,strlen($z)-$pos);
    $z=str_replace("", "(1)
    ", $z);
    echo $z;
    }
    $cats = urlencode( ob_get_clean() );
    }

  2. thekjub9
    Member
    Posted 1 year ago #

    hi thx pls can you advice me where to put this code ? so it works ?
    what has to be before and after your mod.

    2nd can you mod it so that only marked categories are listed ?
    fe.: I have 20categories
    so I use cumulus1 on page1 with categories 1,5,6,8
    I use cumulus2 on page2 with categories 2,3,4
    I use cumulus3 .... etc.

    woudld it be possible ?
    or maybe better by using Tags

  3. glar
    Member
    Posted 1 year ago #

    Hi thekjub9!

    the 3 first lines in my example you can find in wp-cumulus.php and they are unchanged:

    // get categories
    if( $options['mode'] != "tags" ){
    ob_start();

    The next line I commented out: //wp_list_categories(...
    Followed by new code: $mypages...
    until: echo $z;
    }

    The last 2 lines are again unchanged:
    $cats = urlencode( ob_get_clean() );
    }

    Concerning your 2nd problem I can't help you, sorry.

  4. glar
    Member
    Posted 1 year ago #

    Sorry,

    the line with str_replace() has to be:

    $z=str_replace("</li>", "(1)<br />", $z);

Topic Closed

This topic has been closed to new replies.

About this Topic