get post count for related author
You need to read query_posts link to do this. Here you can see ‘author’ – Order by author. Simply you can do: SELECT count(ID) FROM wp_posts groupby author;
You need to read query_posts link to do this. Here you can see ‘author’ – Order by author. Simply you can do: SELECT count(ID) FROM wp_posts groupby author;
Use the get_user_by and get_term_by functions: // user $user = get_user_by( ‘login’, ‘someuser’ ); if( $user ){ echo get_author_posts_url( $user->ID ); } // tag $term = get_term_by( ‘name’, ‘Sometag’, ‘post_tag’ ); if( $term ){ echo get_term_link( $term ); }
I think you are executing reset_postdata() too early, using the global $post object incorrectly inside the secondary loop and passing wrong argumentes to the secondary loop. Try this. Put the function to get the latest author posts in the functions.php file: function the_latest_author_posts($post) { //some content goes here regarding the post itself!!! $relatedargs = array( … Read more
when you use the loop the number of post displayed is choosen fron the option set in Settings->Reading in you backend. It affects all the standard loops, not only the author page. To change only for author page you have to use pre_get_posts hook and set the wanted number of posts using posts_per_page argument: add_action(‘pre_get_posts’,’change_numberposts_for_author’); … Read more
Always the same with those clients … 🙂 Unfortunately your requirements sound pretty custom. Only advise I can give you is to use one of the custom field plugins like Advanced Custom Fields or Types. Those can speed up the development of custom pages like you have by a factor of 10, as you don’t … Read more
get_users has an argument that should let you select a particular role. $all_users = get_users(array(‘role’=>’author’)); Should be all you need. $all_users should be only “Authors”.
If you take a look at template hierarchy archive.php is very generic template, used for all kinds of archives. Going by same chart if you want to add template, which applies to all date archives you should name it date.php.
The wp_insert_post_data filter is the right approach. I would do something like this: add_filter( ‘wp_insert_post_data’, ‘some_handler’ ); function some_handler( $data )//$data is an array of sanitized post data { //do some conditional checking… if ( ! isset( $_POST ) ) {//the request to insert post data wasn’t done by a user return $data; } //don’t … Read more
you can create a function which gives you all users which have role author in a drop down list. Note: It is a dummy example modify it as you want( put this function in functions.php or custom plugin ). Use: Call this function any where in theme like <?php ravs_author_dropdown_list(); ?> function ravs_author_dropdown_list() { // … Read more
Add this CSS code at the end of your child themes style.css file before the Media Queries. .attachment .post-meta { display: none; } .attachment .gallery-meta { display: none; } The responsive theme developers do offer a forum for theme customization support questions. http://cyberchimps.com/forum/