pass query string on url to filter media

As per the given url http….url…/author/name?MediaTag=tag1, below code may helpful… if(isset($_GET[‘MediaTag’])) //It will check the value of MediaTag (from address bar after ?) { $tag1 = $_GET[‘MediaTag’]; //Assigning value of MediaTag to the variable if($tag1) //Checking if variable have some value or not { query_posts(‘cat=1&author=” . $post->post_author . “&order=DESC&tag=’ . $tag1 .’&posts_per_page=12′ . ‘&paged=’ . … Read more

How to display specific posts with WP_Query?

Could be because you are passing an array of array try this: <?php $my_query = new WP_Query(); $my_query->query(array( ‘post__in’ => $curauth->user_favourite_post)); while ($my_query->have_posts()) : $my_query->the_post(); ?> <h3><a href=”https://wordpress.stackexchange.com/questions/27808/<?php the_permalink(); ?>”><?php the_title(); ?></a></h3> <?php endwhile; ?>

Author Nickname URL Friendly

You’ve already used sanitize_title once in you code. You need to use that in again, inside the wpse5742_author_link function. $link = str_replace( $author_nicename, sanitize_title($author_nickname), $link ); That should take care of the spaces. Another other option is to use urlencode but sanitize_title keeps things consistent. I (minimally) tested your code with that change and it … Read more

Create template “author” with a plugin

You can riff off of how WooCommerce and other plugins are providing templates in their plugin, while allowing the theme to override them if they exist. Basically, you hook into the template_include function, which is where WordPress decides what template to load for a given query. Since you want to do something with the author.php … Read more

Showing author’s page with no posts

You can use the get_queried_object where the CODEX says: if you’re on an author archive, it will return the author object So since you have an object, you can return it values: $author = get_queried_object(); echo $author->first_name . ‘ ‘ . $author->last_name; And you can use the same parameters as get_the_author_meta(): user_login user_pass user_nicename user_email … Read more

List user comments in author page

Try with WP_Comment_Query and make sure you have the right Author ID from the Author Template. // WP_Comment_Query arguments $args = array ( ‘user_id’ => $user->ID, ‘post_status’ => ‘approve’, ‘number’ => ’10’, ); // The Comment Query $comments = new WP_Comment_Query; $comments = $comments->query( $args ); // The Comment Loop if ( $comments ) { … Read more

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