how to overwrite next_post_link

You can’t easily change only the URL of that link, because there is no filter that will allow you to do that, but… next_post_link uses get_next_post_link. There are no filters in any of these functions, but… get_next_post_link uses get_adjacent_post_link and inside of that function you can see {$adjacent}_post_link hook. So now we can check docs … Read more

Dealing with the clickTrack event in wp-playlist.js in order to display audio download link on the playlist title row

Update: I found a super simple solution to my question several hours after posting it. It turns out a filter is not needed at all. Adding onclick=’event.stopPropagation();’ to the download link is all that is needed. It will allow for putting the download link on the same title row without affecting the ability to change … Read more

Security question – Display a General Custom Login Error Message

Add the following to your functions.php file. function my_custom_error_messages() { global $errors; $err_codes = $errors->get_error_codes(); // Invalid username. if ( in_array( ‘invalid_username’, $err_codes ) ) { $error=”<strong>ERROR</strong>: Custom Message Here”; } // Incorrect password. if ( in_array( ‘incorrect_password’, $err_codes ) ) { $error=”<strong>ERROR</strong>: Another Custom Message Here”; } return $error; } add_filter( ‘login_errors’, ‘my_custom_error_messages’); You … Read more

Re-order search results with posts_orderby filter and post meta value

Probably it’s just a JOIN problem: the SELECT query has no postmeta fields to order by. Try to implement the second answer from this question. That is, paste this code in your file. function custom_posts_join($join){ global $wpdb; $join .= ” LEFT JOIN $wpdb->postmeta ON $wpdb->posts.ID = $wpdb->postmeta.post_id “; return $join; } add_filter( ‘posts_join’ , ‘custom_posts_join’);

How to take shortcode and content separately from a page?

I found the solution. I used the following codes and it worked for me . To remove the shortcode from the content, I Used this <?php $content = get_the_content(); $content = preg_replace(“/\[.*]/m”, ” “, $content); $content = apply_filters(‘the_content’, $content); $content = str_replace(‘]]>’, ‘]]>’, $content); echo $content; ?> and the following code to get the shortcode … Read more

Print only parent categories of post in custom RSS feed

I’m still interested in hearing how this can be accomplished using the WordPress function the_category_rss(), but I did find another way to do this: <?php $parentsonly = “”; // loop through categories foreach((get_the_category()) as $category) { // exclude child categories if ($category->category_parent == 0) { $parentsonly = ‘<category domain=”‘ . get_category_link($category->cat_ID) . ‘”>’ . $category->name … Read more

how to develop a filter in wordpress to let the user filter the page content depends on the date (newest to oldest etc…)?

I would recommend looking at FacetWP plugin, which is a paid plugin, but it does all of this and more: https://facetwp.com/ If you want to manually do this, there’s numerous ways based on what specifically you’re referring to (blog posts? custom post types?): Sort posts by Date (DESC) and by Title (ASC) WordPress also has … Read more

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