Blog

How to fix WordPress Multisite IIS pagination trailing slash issues

Using WordPress Multisite  (3.3 – 3.4) on IIS7 with the standard URL Rewrite rules causes issues with trailing slashes and pagination links. Visiting a multisite blog without a trailing slash http://mydomain.com/blog1 causes pagination links to repeat and duplicate the blog slug in the URL causing a 404 error: http://mydomain.com/blog1/blog1/page/2/ To fix this, open up wp-includes/link-template.php [...]

wp_nav_menu() generates an extra div?

If wp_nav_menu() is generating an extra and applying the menu_class to it, it’s because the menu you are fetching probably isn’t set in the Admin area under Appearance / Menus. If the menu is not set, then the “menu_class” is applied to a container element. If the menu is set, then the “menu_class” is applied [...]

IIS Web.config Redirect?

To redirect a single page on a website to a new folder location (example: http://site.com/index.html to http://site.com/index/), open web.config in the directory where the old page is and add the following code: Feel free to add as many location tags as you need. To redirect an entire directory to a new location, add this line [...]

Category: IIS | Comments Off

How to create new post thumbnail size in WordPress child themes?

In your child theme’s functions.php, add the set_post_thumbnail_size() function inside a child theme setup function. However, you will need to adjust your child theme setup function to run at a later priority. A child theme is processed before the parent theme. If your parent theme has set_post_thumbnail_size(), then you cannot call the function with default [...]

How do I connect to a database within WordPress?

Are you getting a “Not a valid MySQL-Link resource in wp-db.php” error when trying to connect to another database within your WordPress template pages? If so, it’s because the mysql_connect() function needs the new_link parameter to be set to true. The new_link parameter makes mysql_connect() always open a new link. Since we are not closing [...]

How to get the title for the posts page in WordPress?

What if you want your posts page to have a title other than “Blog” but you don’t want to have to insert the title by hand? Here’s how it’s done. We cannot use the_title() because it is made to be used inside the WordPress loop to display blog post titles. It does not work when [...]