• WordPress version 4.6.1
    PHP version 5.4.45 (32bit)
    Website: https://www.92bulles.fr/
    Theme : Customizr Version : 3.4.23

    Here is my problem :
    I would like to list the members present in the directory of the association alphabetically in the Left Sidebar using the widget Recent Posts
    I’ve found this code which working quite well

    add_filter( 'widget_posts_args', 'my_widget_posts_args');
    function my_widget_posts_args($args) {
    if ( is_category('annuaire') )
    { //filtre les articles ayant une catégorie annuaire
    $cat = get_queried_object();
    return array(
    'orderby' => 'post_title',
    'order' => 'ASC',
    'posts_per_page' => 100,//set the number you want here
    'no_found_rows' => true,
    'post_status' => 'publish',
    'ignore_sticky_posts' => true,'cat' => $cat -> term_id//the current category id
    );
    }
    else {//keeps the normal behaviour if we are not in category context
    return $args;
    }
    }

    The only problem will be when all our adherents will be listed, the Left SideBar it will be too long so I’d like too limit the list of 20 adherents and add a function ” Previous/Next Adherents”
    I’ve got notions of programmation but I don’t know php code

    If you can help

    • This topic was modified 8 years, 2 months ago by Tandhruil.
  • The topic ‘Alphabetic list of adherents’ is closed to new replies.