Category Archives: Programming

WordPress Logo

Stay logged in with WordPress on Subdomains

A clients site performs some magic to show different content per subdomain. By default each subdomain asks you to login, which is a bit annoying. It would be convenient if admins of a single WordPress installation could stay logged in when they jump between subdomains.

I found that all we needed to do was set the cookie domain and path in wp-config.php. At first it seemed only COOKIE_DOMAIN and COOKIEPATH would be needed, but it did not behave until COOKIEHASH was also set. You could probably set it to anything you like, I just had a defined variable already.

This may also work between WordPress installations across subdomains. I haven’t tested this theory. Both installations would require the same login details and this config. It is working with WordPress versions 3.8+.

WordPress Logo

How to Improve FeedWordpress

FeedWordPress is the best free plugin to syndicate posts from WordPress RSS feeds. Syndication is not the best practice, but it suits the needs of a client and their site network.

However, there is some minor issues. There is no built in duplicate post detection. This can create a mess when syndicating multiple feeds that may contain the same posts. Also, a default category is not assigned to posts if there is no matching category on your site. Place the below filter in your themes functions.php file to correct these issues.

Lastly, we don’t want search engines to index these articles, they aren’t original content on our site. I also make use of Yoast WordPress SEO, we’ll use that to our advantage.

WordPress Logo

Add a Custom Login Logo to WordPress

Below is all you need to customise the login page of WordPress. Add it to the bottom of your functions.php.

There are plugins available that perform this task for you, but I don’t think it’s necessary to add a plugin just for this.

Transparent PNG format images work best.

Update 2017

I have upgraded this script to use the Site Icon. You just need to upload your image using Appearance > Customise > Site Identity.

Update 2019

WordPress deprecated ‘login_headertitle’ in favour of ‘login_headertext’.