How to add CSS Class to previous_post_link or get previous/next post link URL

You can use the more native function that is “below” the previous_/next_post_link();: # get_adjacent_post( $in_same_cat = false, $excluded_categories=””, $previous = true ) $next_post_obj = get_adjacent_post( ‘”https://wordpress.stackexchange.com/questions/17218/,”‘, false ); $next_post_ID = isset( $next_post_obj->ID ) ? $next_post_obj->ID : ”; $next_post_link = get_permalink( $next_post_ID ); $next_post_title=”&raquo;”; // equals “»” ?> <a href=”https://wordpress.stackexchange.com/questions/17218/<?php echo $next_post_link; ?>” rel=”next” class=”pagination pagination-link … Read more

WordPress Pagination Not Working – Always Showing First Pages Content

Why your current code fails Your always getting the content of the first page, because the string of parameters passed to query_posts being encapsulated in single quotes prevents variables (as well as escape sequences for special characters other than $) to be expanded. query_posts(“post_type=videos&posts_per_page=9&paged=$paged”); would take care of that problem. query_posts(‘post_type=videos&posts_per_page=9&paged=’.$paged); would also. And finally, … Read more

Get current URL (permalink) without /page/{pagenum}/

You can get the current URL through home_url( $wp->request ). Try the example below: global $wp; // get current url with query string. $current_url = home_url( $wp->request ); // get the position where ‘/page.. ‘ text start. $pos = strpos($current_url , ‘/page’); // remove string from the specific postion $finalurl = substr($current_url,0,$pos); echo $finalurl;

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