numberposts not responding to wp_reset_postdata()

@Milo’s answer worked perfectly (see comment above). if (in_array($post->ID, $do_not_duplicate)) continue; meant that duplicate posts were still being counted in the loop, though not being displayed. To fix, remove this line, and exclude duplicate posts from the query with this argument: ‘post__not_in’ => $do_not_duplicate. Thank you @Milo for your swift and succinct response.

Make custom WordPress comments list

You have just created the template. You still need to create the entire function of the form. It would be easier to just copy a comment.php and then edit it out with some CSS to get it to look like what you want it to. The link below is for a default comment.php that should … Read more

Adding options to loop

You can use the add_meta_boxes hook to place a text field in the desired pages. Then on the template page you can check whether the user has entered some categories (display all categories if not) and filter the loop using the WP_Query, query_posts() or get_posts(). Here is an excellent article on the three methods.

Add specific class to featured posts

I hope that “featured” will be a custom field of posts. In that case you can check the value of field using: $desc = get_post_meta($post->ID, ‘featured’, true); You can use if-else condition and check that if you get value=1 {or what you assigned for featured} then apply class”hot”. Give it a try. best of luck

how to place Post and page content side by side

I am suggesting you to use two for loop using two post types. For blog post use below code <?php query_posts( array( ‘post_type’ => array( ‘post’) ‘showposts’ => 5 ) ); ?> <?php while ( have_posts() ) : the_post(); ?> <div class=”post_type”> <a href=”https://wordpress.stackexchange.com/questions/203262/<?php the_permalink(); ?>”><?php the_title(); ?></a> <div class=”excerpt”> <?php echo get_the_excerpt(); ?> </div> … Read more

Foreach loop inside foreach loop?

Your 2nd foreach loop is a bug. $slug is a string with a single value, and you cannot pass a string to a foreach loop. If you set debug to true, you will see an error message telling you just this. You can simply just do //Different markers for different types $car_type = get_the_terms( $post->ID, … Read more

Custom Looping of WordPress Posts

Hi I believe this should work <div class=”col-xs-8″> <?php $count = 1; ?> <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> <?php if $count = 1; ?> <!– First post Wrapper–> <div class=”first-post”> <article class=”post1″></article> </div> <!– Rest all post Wrapper–> <div class=”all-posts”> <?php else : ?> <article class=”post<?php echo … Read more

the_content() keeps repeating itself

Solved. This was due to reveal using an ID (see myModal ID) and iterating the same ID over and over again. As a fix, I used: id=”modal-<?php echo get_the_ID(); ?>” This has solved my issue of the_content() repeating its first iteration over and over.

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