How to make post button to a random post
In wordpress for get random post you have a option with ‘orderby’ => ‘rand’
In wordpress for get random post you have a option with ‘orderby’ => ‘rand’
get_the_ID gives you the ID of the current post, but at no point during that loop do you change what the current post is. It’s always the last post processed in the previous loop because that’s the last time you called the_post(). This is why you always get the same ID. Instead, store the ID: … Read more
I found a solution which displays the posts ordered by the date value, and also removes the past ones. <div class=”container”> <div class=”row”> <table> <tr> <th>Artista</th> <th>Fecha</th> <th>Ciudad</th> <th>Información</th> </tr> <?php $today = current_time(‘Ymd’); $args = array( ‘post_type’ => ‘evento’, ‘post_status’ => ‘publish’, ‘posts_per_page’ => ‘-1’, ‘meta_query’ => array( array( ‘key’ => ‘fecha_del_evento’, ‘compare’ => … Read more
The simplest solution: echo get_the_category_list( ‘, ‘ ); Following your way: Change your $args like so: $args = array( ‘template’ => ‘%2$l’, ‘term_template’ => ‘%2$s’, ); And then, add this to your functions.php file (this will affect all %l markers!); add_filter( ‘wp_sprintf_l’, function($templates) { // $templates[‘between_last_two’] = sprintf( __(‘%s, and %s’), ”, ” ); // … Read more
Custom Taxonomy Link Text Echo Name Not Slug
How to solve this script problem in theme directory?
You can get the diff between your 2 contents and then add to the first one a given number of words like this (not sure, but give it a try 😉 ) : global $more; $more = 0; $content_cut = get_the_content( ” ); $more = 1; $content_full = get_the_content(); // Get the diff $content_diff = … Read more
There are some plugins that add the next/prev links in <head> and follow Google recomendations for paginated archives, which are similar to recomendations for infinite scroll. If you are interested in doing it at yor own, you can implement the ajax load-more in archive templates and do something like this (not fully tested, just an … Read more
Template included with plugin doesn’t return all posts for custom taxonomy
You are using default category for custom post type. You can instead use a taxonomy query to get filtered result based upon your custom taxonomy terms. Try this – $cat_ids = array(); $postID = get_the_ID(); $categories = get_the_terms($postID, ‘custom_taxonomy_name’); //this will give all the terms foreach($categories as $cat) { $cat_ids[] = $cat->term_id; //you may put … Read more