• Hello agent, I need a hint:

    I Want a most simple call for sth. like
    “wp_list_posts()” in my sidebar,
    but NO PLUG !
    So far I got it working, but I feel like
    this is a unfortunate way of coding.

    HOW COULD THIS BE DONE PROPERLY WITHIN THE THEME ??
    maybe via functions.php ??
    – – – – – – – – – – – – – – – – – – – – – – – – –
    changed wp-includes/general-template.php line 1501 ,
    though I know that’s basically not good:

    //$output .= get_archives_link( $url, $text, $r['format'], $r['before'], $r['after'] );
    
    // added two lines
    $oneli = "<li>" ; $twoli = "</li> ";
    $output .= get_archives_link(  $url, $text, $r['format'], $oneli, $twoli );

    _____________________________________________________________________
    my sidebar PHP:

    echo "<ul id=\"xoxo\">\n";
    wp_get_archives('type=postbypost&type=alpha&format=custom');
    echo "</ul>\n";

    Thank you for taking your time, FBL

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter b-frank

    (@b-frank)

    Thread Starter b-frank

    (@b-frank)

    Thread Starter b-frank

    (@b-frank)

    found a maybe.. thanks here

    $posts = get_posts('&order=asc&exclude=1&format=custom' );
    if($posts){
    	echo "<ul id=\"xoxo\">\n";
    	foreach ($posts as $post)  {
    echo '<li><a href="'.get_permalink($post->ID).'">'.$post->post_title.'</a></li>';
    echo '</ul>';
    } // end if($posts)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘WordPress list posts simply in sidebar’ is closed to new replies.