how do i make this loop work

You should clean it up some more but this will fix your code: <?php get_header(); ?> <div class=”posts”><!– BLOG –> <!– Shapes on sides –> <div class=”shapes_left”> </div> <div class=”shapes_right”> </div> <?php if (is_tag()) { ?> <div id=”archive_title”> <h1><?php single_tag_title(); ?></h1> <?php }?> </div> <div id=”featured_home”> <?php $counter = 0; while ( have_posts() ) { … Read more

Remove posts_orderby filter then add it back in

To add back the filters that were removed you’d have to know what was hooked in originally in the first place. You could crawl the global $wp_filter array, but this should do the same at far less effort: function remove_query_order($order) { remove_filter(‘posts_orderby’,’remove_query_order’,PHP_INT_MAX); return ”; } add_filter(‘posts_orderby’,’remove_query_order’,PHP_INT_MAX); Add the filter before the query you want it … Read more

Ajax loop and history.js for SEO

There are some plugins that add the next/prev links in <head> and follow Google recomendations for paginated archives, which are similar to recomendations for infinite scroll. If you are interested in doing it at yor own, you can implement the ajax load-more in archive templates and do something like this (not fully tested, just an … Read more

Echo Most Recent Sticky Post in Loop?

If it’s your main loop, you could add this to your function.php: function custom_pre_get_posts($query) { if($query->is_main_query() && /* is sticky conditional tag(sorry I need to check what is that) */) { $query->set(‘posts_per_page’, “1”); } } add_action(‘pre_get_posts’, ‘custom_pre_get_posts’); Or you can make a new WP_Query instance in the theme file: <?php $onePost = new WP_Query(array( ‘post_type’ … Read more

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