Sort by page information by Ascending Numbers

Use custom fields wp_query Ex <?php $args = array( ‘post_type’ => ‘page’, ‘meta_query’ => array( array( ‘key’ => ‘mytitle’, ‘value’ => ‘title’, ‘orderby’ => ‘mytitle’, ‘order’ => ‘DESC’ ), ) ); $query = new WP_Query( $args ); if ( have_posts() ) while ( $wp_query->have_posts() ) : $wp_query->the_post(); ?> <tr> <td><?php echo the_field(‘educational_ranking’); ?></td> <td><a href=”https://wordpress.stackexchange.com/questions/60150/<?php … Read more

Sorting a query Field by date

&orderby=date will return posts by their dates. <?php query_posts(‘post_type=page&post_parent=2&posts_per_page=-1&orderby=date&order=ASC’); ?> Replace first line with this to show post according to their date. Reference – Passing variables to query_posts Update – To sort the posts as per custom field value, Here’s the new code. query_posts(‘post_type=post&posts_per_page=-1&orderby=meta_value&meta_key=next_open_day&order=ASC’); ?> Note – The date should be saved in – YYYY-MM-DD … Read more

Query Page Content From Theme Options?

Figured it out myself, for anyone else that needs help here are the two options.. <!–Method 1–> <?php $query = new WP_Query(); $query->query(‘post_type=page&p=’ . of_get_option(‘slide_page1’));while ($query->have_posts()) : $query->the_post(); ?> <?php the_title(); ?> <?php endwhile; wp_reset_query(); ?> <!–Method 2–> <?php $slide1 = of_get_option(‘slide_page1’);?> <?php $loop = new WP_Query( array(‘p’ => $slide1, ‘post_type’ => array(‘post’, ‘page’), )); … Read more

background images WP Supersized on homepage

query_posts Avoid this function at all costs. The likely cause of your problem is queries not cleaning up after eachother. Your call to query_posts will have modified the main query ( wasting the original ), and messed up everything following it. Instead use WP_Query followed by wp_reset_postdata $query = new WP_Query(‘cat=17&posts_per_page=1&meta_key=FeaturedOnHomepage&meta_value=yes’); if($query->have_posts()){ while ($query->have_posts()) { … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)