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()

WP Query conflict on tag.php and category.php template

Just in case anyone happens to run into this same problem, my round-about solution for taxonomy template query conflict: clone the main query NULL the query define new WP_Query re-instate cloned query Tested and working in header.php <?php global $wp_query; $temp_query = clone $wp_query; global $post; $temp_post = clone $post; $wp_query = NULL; $wp_query = … Read more

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

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