Tag Info

Hot answers tagged

3

What you need to use here is the WP_Comment_Query() function. So on the author.php page, you can easily get the author info and ID as followed: // get author info $curauth = (isset($_GET['author_name'])) ? get_user_by('slug', $author_name) : get_userdata(intval($author)); // set ID $user_id = $curauth->ID; Then we add the user ID in the query ...


2

One of the hard requirements of WordPress theme is presence of style.css file with a header. It doesn't go beyond file being present or even used at all, it can be otherwise empty. The CSS itself has no requirements on WP side and falls under generic web development.


2

Nice sleuthing. Every single person on this SO site has been foiled by something exactly like this at one point or another with the WordPress template hierarchy. You might think of this backwards though. All the steps you found lead you back to the shortcode [pmpro_account] which gets output in the loop-myaccount.php by way of the_content(). That ...


1

First of all: do not use query_posts use get_posts or new WP_Query instead. If you want to show only most viewed posts, you'll need to add action ( for ex. wp ) check if your on single post page and update that post meta views ( +1 ). Then you could do something like these $topViewedPosts = new WP_Query( array( 'post_type' => 'post', 'meta_key' ...


1

$count is just an arbitrary variable name. If you're using a separate loop to get tags and stop after a certain number (as shown on https://codex.wordpress.org/Function_Reference/get_the_tags), replace the $count variable in that example code with something like $tag_count or $counting or $treebark, and it won't mess up your use of $count in the posts Loop ...


1

First method, you are missing the second parameter for get_the_author_meta, which is the ID of the author. Second method, you are using undefined variables.. Check this code, should get you what you want. // Method 1 <ul class="authpcom"> <?php $queried_object = get_queried_object(); $author_email = get_the_author_meta( ...


1

It's actually only important to use it if your theme's CSS or JS is reliant on something it outputs. It essentially stuffs relevant class names into the HTML tag you put it on based on the current post/category/blah/blah. So, on a single post template this: <article <?php post_class(); ?>> might output: <article class="post post-123 ...



Only top voted, non community-wiki answers of a minimum length are eligible