Infinite Redirect Loop after moving to subdirectory

As mentioned in my comment, ensure you test the following in a “clean” browser: Set siteurl & home to http://www.example.com/wordpress-subdirectory Set permalink_structure to nothing Set active_plugins to nothing Ensure there are no WP_SITEURL or WP_HOME constants defined in your wp-config.php Remove all rewrite rules to do with WordPress from your .htaccess Not of all these … Read more

Better way to display posts from specific categories, in a grid layout

I think the general suggestion is to use WP_Query instead of query_posts partly because query_posts used WP_query in a simplified way and can cause problems down the road. So for sure check out the WP_Query page, specifically the Multiple Loops example: http://codex.wordpress.org/Class_Reference/WP_Query#Multiple_Loops So the code using WP_Query would look something like this: <?php $counter = … Read more

How to split a loop into two columns

You will need to create css classes for a left and right column (you can use bootstrap if you like) after creating the classes try this <div class=”headlines” data-interval=”<?php echo ($interval>0)?$interval*1000:’false’; ?>”> <ul> <?php $i = 0; while ( $r->have_posts() ) { $r->the_post(); if($i % 2 == 0){ //even line ?> <li class=”left-col”><a href=”https://wordpress.stackexchange.com/questions/191730/<?php the_permalink(); … Read more

Show a different post every 3 days [duplicate]

Your code example isn’t random though, it’s a fixed offset, based on a week number. As stated this isn’t something that can be expressed in query API I think. You would probably have to keep track of state with something like following algorithm: Query a random post, store its ID Store a date three days … Read more

Creating a multi-taxonomy query, excluding the newest (read: highest ID) taxonomy term

Have you considered using a more standard loop, like this? I think it might fix your issue #3. $query = new WP_Query( $args ); echo ‘<div class=”home-middle widget-area”>’; echo ‘<h4 class=”widget-title widgettitle”><span>From the Archives</span></h4>’; if ($query->have_posts()) { while ($query->have_posts()) { $query->the_post(); echo ‘<article class=”post type-post status-publish format-standard has-post-thumbnail entry”>’; echo ‘<a href=”‘ . get_the_permalink() . … Read more

Removing the_content() from the page

If you look at the codex (here) you’ll see that the_content() is just a wrapper for get_the_content() which passes it through the the_content filter. So, you too can hook into that filter to change your content output without having to edit the theme files.

How to retrieve “sticky” post outside the “loop”?

I am using this query; <?php $sticky = get_option( ‘sticky_posts’ ); // Get all sticky posts rsort( $sticky ); // Sort the stickies, latest first $sticky = array_slice( $sticky, 0, 1 ); // Number of stickies to show query_posts( array( ‘post__in’ => $sticky, ‘caller_get_posts’ => 1 ) ); // The query if (have_posts() ) { … Read more

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