Displaying content to search engines but via navigation only for registered users.

You can detect where the user comes from (like Google) using HTTP_REFERER. <?php if (strpos($_SERVER[‘HTTP_REFERER’], “google”) == true) { echo “Hello Google User!”; } ?> So for your logged-in user: <?php if ( current_user_can( ‘subscriber’ ) && strpos( $_SERVER[‘HTTP_REFERER’], ‘google’ ) ) { ?> [content here] <?php } ?> Important Links wp_get_referer()

Hierarchical List Pages as a table

With such custom requirements it’s unlikely you will just happen upon a snippet to achieve it. This is considerable chunk of customization and working with hierarchical data is always challenging. When you are working with wp_list_pages() what is happening in background is that it compiles data and passes to instance of Walker_Page class, that extends … Read more

New WordPress WP Query using posts from certain categories

There are some errors in your code, you have to change: $the_query -> have_posts() to $the_query->have_posts() $the_query -> the_post() to $the_query->the_post() WP_Query array(…) to WP_Query(array(…)) ‘showposts=6’ to ‘posts_per_page’ => 6 Try this instead $the_query = new WP_Query( array( ‘category_name’ => ‘portfolio’, ‘posts_per_page’ => 6 ) ); while ($the_query->have_posts()) : $the_query->the_post(); the_post_thumbnail(); endwhile;

Custom query to show posts

You can do it with wp_query $args = array( ‘post_type’ => ‘post’, ‘numberposts’ => -1, ‘posts_per_page’=> -1, ‘orderby’ => ‘meta_value_num’, ‘meta_key’ => ‘ratings_average’, ‘order’ => ‘DESC’, ); $posts = new WP_Query($args); Now the result is DESC Order.