Portfolio items reorder


  • Member
    jdong
    August 2, 2015 at 10:08 am #22424

    Dear BlueOwl,

    I was following this old discussion to change the order of my portfolio items(http://blueowlcreative.com/support_wp/forums/topic/portfolio-items-order/), But for some reason I just couldn’t make it work. Please point me to right direction.

    The original code from the editor, Aqua: Template – Portfolio Page Page Template (portfolio-three-column.php):

    <ul id=”portfolio_items” class=”clearfix”>
    <?php
    $args = array(
    ‘post_type’ => ‘portfolio’,
    ‘posts_per_page’ => (ot_get_option(‘portfolio_items_per_page’,9) ? ot_get_option(‘portfolio_items_per_page’,9) : 9),
    ‘paged’ => $paged
    );

    $gallery = new WP_Query($args);
    while($gallery->have_posts()): $gallery->the_post();
    if(has_post_thumbnail()):

    $data_types = ”;
    $item_cats = get_the_terms($post->ID, ‘portfolio_category’);
    if($item_cats):
    foreach($item_cats as $item_cat) {
    $data_types .= $item_cat->slug . ‘ ‘;
    }
    endif;

    I made the change to:
    No.1

    <ul id=”portfolio_items” class=”clearfix”>
    <?php
    $args = array(
    ‘post_type’ => ‘portfolio’,
    ‘posts_per_page’ => (ot_get_option(‘portfolio_items_per_page’,9) ? ot_get_option(‘portfolio_items_per_page’,9) : 9),
    ‘paged’ => $paged

    );
    $query = new WP_Query( array ( ‘orderby’ => ‘title’, ‘order’ => ‘DESC’ ) )
    $gallery = new WP_Query($args);

    It doesn’t work. The whole page is gone.

    No.2

    $args = array(
    ‘post_type’ => ‘portfolio’,
    ‘posts_per_page’ => (ot_get_option(‘portfolio_items_per_page’,9) ? ot_get_option(‘portfolio_items_per_page’,9) : 9),
    ‘paged’ => $paged
    ‘orderby’ => ‘title’
    ‘order’ => ‘DESC’
    );
    $gallery = new WP_Query($args);

    It doesn’t work. when i refresh, the whole page is gone.

    No.3

    $args = array(
    ‘post_type’ => ‘portfolio’,
    ‘posts_per_page’ => (ot_get_option(‘portfolio_items_per_page’,9) ? ot_get_option(‘portfolio_items_per_page’,9) : 9),
    ‘paged’ => $paged
    ‘orderby’ => ‘title’
    ‘order’ => ‘DESC’
    );
    $query = new WP_Query($args);

    $gallery = new WP_Query($args);

    It doesn’t work also. when i refresh, the whole page is gone.

    Please help me with a right code, thank you so much!

    Sorry, this forum is for verified users only. Please Login or Register to continue

Comments are closed.