Get first comment link on the post itself

you can get comment link by wp function $args = array( ‘number’ => ‘1’, ‘post_id’ => your_post_id, // use post_id, not post_ID ); $comments = get_comments($args); <a href=”https://wordpress.stackexchange.com/questions/108654/<?php echo get_comment_link( $comments->comment_ID ); ?>”>postname</a>

Get post id on click of thumbnail

You need ajax. The html: <div id=”PersonBio”></div> <div id=”mainTextTitle”></div> <div id=”mainText”> <ul class=”faces”> <?php $categories = get_categories(); foreach ( $categories as $category ) { $i = -1; echo ‘<div class=”grid-row”><h2>’ . $category->name . ‘</h2></div>’; $args = array( ‘posts_per_page’ => -1, ‘cat’ => $category->term_id ); $cat_posts = new WP_Query($args); if ( $cat_posts->have_posts() ) : while ( … Read more

Single post page from static home not working

See the change of get_permalink to the_permalink This might work for you. <?php $args = array( ‘numberposts’ => 5, ‘order’=> ‘ASC’, ‘orderby’ => ‘date’ ); $postslist = get_posts( $args ); foreach ($postslist as $post) : setup_postdata($post); ?> <div class=”single_post”> <h3><?php the_date(); ?></h3> <h3> <a href=”https://wordpress.stackexchange.com/questions/109174/<?php the_permalink();?>”> <?php the_title(); ?> </a> </h3> <?php the_excerpt(); ?> </div> … Read more

Howto put advertising as post number 1,2,3 etc

You can use this property of WP_Query: $current_post (available during The Loop) Index of the post currently being displayed. Let’s say you have your current version of loop: <?php while ( have_posts() ): the_post(); ?> … some code that is displaying current post <?php endwhile; ?> Change it to something like this: <?php while ( … Read more

Trying to display stick or featured post on homepage

Try this. It should work <?php $args = array( ‘post__in’ => get_option(‘sticky_posts’), ‘showposts’ => 1, ‘orderby’ => date, ‘order’ => ‘desc’ ); $sticky = new WP_Query( $args ); if ( $sticky->have_posts() ): while ( $sticky->have_posts() ): $sticky->the_post(); echo the_title(); endwhile; endif; wp_reset_query(); ?>

Count > 1 Navigation Slider

This is a basic PHP error, you need to turn on debugging. $count_slider is an Object and not an Integer which is what you are checking for, since you seem to want to compare published posts anyhow , write it like: <?php if($count_slider->publish > 1)