Add to previous posts under post

Try to add date_query to the $qry in the solution mentioned here. $qry = new WP_Query( array( ‘cat’ => $current_post_categories[0], ‘posts_per_page’ => 2, ‘post__not_in’ => array( $current_post_id ), ‘date_query’ => array( array( ‘before’ => $post->post_date, ), ), ));

How to Populate the list of custom post type categories

The second param fort historia function is deprecated, so it would be much nicer to pass params as an array: $terms = get_terms( array( ‘taxonomy’ => ‘vcategory’, ‘hide_empty’ => false, ) ); But if you want to show a select filled with terms of given taxonomy, there’s a function for that: wp_dropdown_categories( array( ‘show_option_all’ => … Read more

jQuery functions only work on homepage

Replace this line: <img src=”https://wordpress.stackexchange.com/questions/285006/<?php header_image();?>” height=”120px;” width=”100px;” alt=””/ class=”siteLogo”> with the following, to fix the invalid / and dimensions. <img src=”https://wordpress.stackexchange.com/questions/285006/<?php header_image();?>” height=”120″ width=”100″ alt=”” class=”siteLogo” /> Replace this markup: <span class=”spanish”>español</span> | <span class=”english”>english</span> with the following: <span class=”spanish” data-target=”.topBar .spanishNav”>español</span> | <span class=”english” data-target=”.topBar .englishNav”>english</span> Change your JavaScript to the following: jQuery.noConflict(); … Read more

MySQL query performed 4 times inside loop

Using a plugin to run PHP code inside your content is not the sanest thing to do, especially when said code is not idempotent. Basically, you cannot guarantee that your code will only run once per page load, since several different things in the system may be processing your content, and thus executing your code, … Read more

How to Append to the_excerpt() Function

function custom_excerpt_more( $more ) { return ‘…’; // <– your end string } add_filter( ‘excerpt_more’, ‘custom_excerpt_more’ ); http://codex.wordpress.org/Plugin_API/Filter_Reference/excerpt_more The above solution is the preferred, but to make this work: <p class=”extra”><?php the_excerpt() . $more; ?></p> Change it to: <p class=”extra”><?php the_excerpt(); echo $more; ?></p>

removing tags from wp_list_pages() using PHP

You could try to remove them, but maybe it’s easier to not generate them in the first place. The page list is displayed by a Walker. This is a class that “walks” over all the items in the tree, and displays them. wp_list_pages() by default (via walk_page_tree()) uses the Walker_Page class, which displays everything in … Read more