• m1playas15
    October 30, 2014 at 5:24 pm #100466

    Hello, how can I make my agents appear on Alphabetical Order ??

    THanks

    ——–

    Answer:

    in agent-list.php

    add in here
    $args = array(
    ‘post_type’ => ‘estate_agent’,
    ‘paged’ => $paged,
    ‘posts_per_page’ => 10);

    this

    ‘orderby’ => ‘title’,
    ‘order’ => ‘DESC’  sau ASC

    You should write the PHP code yourself as you’re copying wrong formatting.

    I made a screenshot of how the code should look in agents_php for ASC order by title

    order by alphabet agents

    • This topic was modified 2 years, 6 months ago by  Anna.
    • This topic was modified 2 years, 6 months ago by  Anna.
    • This topic was modified 2 years, 6 months ago by  Anna.
    Anna
    October 31, 2014 at 11:12 am #100477

    Hi,

    Please see this forum for instructions: http://wpestate.org/forums/topic/order-agents-alphabetically-in-agent-list/

    Thank you,
    Anna

    m1playas15
    October 31, 2014 at 10:59 pm #100492

    I placed the code, but my agents are not showing up fully in order.

    Anna
    November 11, 2014 at 9:42 am #100618

    Hi m1playas15,

    If the query you changed is not applying, you may need to review the code or to update the query. At this point I can only recommend to review the code or to go to WordPress for further modifications http://codex.wordpress.org/Class_Reference/WP_Query (look for orderby).

    Thank you,
    Anna

    bruce1
    November 13, 2014 at 2:16 pm #100662

    Hi Anna, to be clear did you mean to copy in agents-list.php I do no see agent-list.php

    When I do I get error
    Parse error: syntax error, unexpected T_DOUBLE_ARROW in /home/nhrealty/public_html/wp-content/themes/wpresidence/agents_list.php on line 32

    bruce1
    November 13, 2014 at 2:22 pm #100663

    This is how it looks in file now

    <div id=”listing_ajax_container_agent”>
    <?php
    $args = array(
    ‘post_type’ => ‘estate_agent’,
    ‘paged’ => $paged,
    ‘posts_per_page’ => 10 );
    ‘orderby’ => ‘title’,
    ‘order’ => ‘DESC’ sau ASC

    $agent_selection = new WP_Query($args);
    while ($agent_selection->have_posts()): $agent_selection->the_post();
    print ‘<div class=”col-md-‘.$col_class.’ listing_wrapper”>’;
    get_template_part(‘templates/agent_unit’);
    print ‘</div>’;
    endwhile;

    Anna
    November 13, 2014 at 3:41 pm #100664

    Hi Bruce

    You should not copy paste 🙂

    You should write the PHP code yourself as you’re copying wrong formatting.

    I made a screenshot of how the code should look in agents_php for ASC order by title

    Thank you
    Anna

    order by alphabet agents

    • This reply was modified 2 years, 6 months ago by  Anna.
    • This reply was modified 2 years, 6 months ago by  Anna.
    bruce1
    November 13, 2014 at 4:27 pm #100670

    Much better, thanks Anna

You must be logged in to reply to this topic.

Contact Us

We're not around right now. But you can send us an email and we'll get back to you, asap.