WordPress.org

Ready to get started?Download WordPress

Forums

Edit query_post onchange select box() (2 posts)

  1. mdviky87
    Member
    Posted 11 months ago #

    I'm New to WordPress

    In category page, i have select box for change the posts by authors in that category

    My select box

    <select name="sortByAuth">
    <option value="0">By Author</option>
    <?php
    $authors = get_users('role=author');

    if(isset($authors) && !empty($authors)) {
    foreach($authors as $author) :
    ?>
    <option value="<?php echo $author->ID; ?>"><?php echo $author->display_name; ?></option>
    <?php
    endforeach;
    }
    ?>
    </select>

    Now i want posts by selected author from select

  2. mdviky87
    Member
    Posted 11 months ago #

    It must on the same page.

Reply

You must log in to post.

About this Topic