root-relative links for multiple parked domains

I tracked the function calls in my theme (a child theme of Oenology by Chip Bennett) and wp-include that generate the links, found the home_url() function, and then wrote these functions for my site: function gregory_make_relative($url=””) { return preg_replace( ‘#^https?://[^/]+/#iu’, “https://wordpress.stackexchange.com/”, $url, 1 ); } add_filter( ‘home_url’, ‘gregory_make_relative’, 11, 1 ); I intentionally grep-searched to … Read more

Is it possible to add a first and latest posts link?

What you need are $GLOBALS[‘wp_query’]->max_num_pages and get_pagenum_link(). Then you just have to compare get_query_var( ‘paged’ ) with max_num_pages and create a link if they are not equal: /** * Link to last page of a paged archive. * * @param string $text Link text * @return string Nothing if we are on the last page, … Read more

Remove link preview in discussion dashboard

Since version 4.1.6, Akismet has a filter which allows you to disable these “mShots” (the site preview popups): <?php function disable_akismet_mshots( $value ) { return false; } add_filter( ‘akismet_enable_mshots’, ‘disable_akismet_mshots’ );

A plugin for having rel=”nofollow” in posts?

you can add a filter in your functions.php add // Nofollow in content add_filter(‘the_content’, ‘my_nofollow’); function my_nofollow($content) { //return stripslashes(wp_rel_nofollow($content)); return preg_replace_callback(‘/<a[^>]+/’, ‘my_nofollow_callback’, $content); } function my_nofollow_callback($matches) { $link = $matches[0]; $site_link = get_bloginfo(‘url’); if (strpos($link, ‘rel’) === false) { $link = preg_replace(“%(href=\S(?!$site_link))%i”, ‘rel=”nofollow” $1’, $link); } elseif (preg_match(“%href=\S(?!$site_link)%i”, $link)) { $link = preg_replace(‘/rel=\S(?!nofollow)\S*/i’, ‘rel=”nofollow”‘, … Read more

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