jinegev
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Alphabetical Indexhttps://tutsocean.com/wordpress/filter-posts-alphabets-wordpress/ “Sorry no listing found!” every time i click on the index
Forum: Fixing WordPress
In reply to: How to get 3 lines on the title pageWhich theme are you using generally try to use something like this
$query = new WP_Query(array( 'post_status' => 'publish', 'orderby' => 'title', 'order' => 'ASC', 'posts_per_page' => -1 )); $post_count = $query->post_count; $posts_per_column = ceil($post_count / 4); $rows = array(); $count = 0; while ($query->have_posts()) { $query->the_post(); if($rows[$count] == ""){ $rows[$count] = '<div class="row">'; } $rows[$count] = $rows[$count] . '<div class="col-sm-3">' . '<div class="post-title"> <a href="'.get_permalink().'">'.get_the_title().'</a></div>' . '<div class="post-author">by '. get_the_author() .'</div></div>'; $count++; if ($count == $posts_per_column ) { $count = 0; } } foreach ($rows as $row) { echo $row . '</div>'; }Forum: Fixing WordPress
In reply to: Alphabetical Indexim trying to create an alphabetical index https://mk0barn2t6l75xhh9gm.kinstacdn.com/wp-content/uploads/2018/02/example.gif the top of it shows letters and i want a similar solution for my posts
Forum: Fixing WordPress
In reply to: Pagebuilder Framework Query QuestionThank you !!! who thought that all you need is 1 line like $query->set(‘posts_per_page’, xxx); in functions php
here is a solution
add_action( ‘pre_get_posts’, ‘my_change_sort_order’);
function my_change_sort_order($query){
if(is_archive()):
is_post_type_archive( $post_type )
//Set the order ASC or DESC
$query->set( ‘order’, ‘ASC’ );
//Set the orderby
$query->set( ‘orderby’, ‘title’ );
//Set the amount of post
$query->set(‘posts_per_page’, xxx);
endif;
};`