Archive for the ‘WordPress’ Category

All posts in WordPress category.

WordPress Update: WordPress 3.5 is Available

0

Posted by: jzelazny on December 12, 2012

Categorized: SDAC Blog, WordPress, WordPress Updates

Tagged: ,

WordPress 3.5 is now available for download. This update contains great updates to the media workflow, a new theme, updated dashboard styling, and a number of other fixes/enhancements which makes this a great release. If you have not done so already – you can watch a video about all the updates: http://wordpress.org/news/2012/12/elvin/ or just download it and enjoy!

For a good overview on all the changes – take a look: http://codex.wordpress.org/Version_3.5

Download WordPress 3.5

Update Your Outdated WordPress Site

0

Posted by: jzelazny on October 10, 2012

Categorized: Clients, WordPress Updates

Tagged: ,

In the last week – I have updated a number of out of date WordPress sites for clients. Some were running WordPress before version 3 (which came out in June 2010 – over 2 years ago). Others were only a point release or two behind. Many clients are nervous about updates, while others want to update every six months. In reality – not keeping up to date should make you more nervous about updating your site and scheduled updates – while they sound nice – do not always work.

Thankfully the reason for all the recent updates were not because of any hacks – the important lesson here is that it is essential to update as soon as possible. Not only will your site be more secure but updating a point release at a time is a lot easier than updating a site from several versions back. Things change, code improves, other code depreciates. Updating your version of WordPress is a lot less painless when you do it often and regularly vs. in an emergency because of a hack.

While updating WordPress is essential – so is keeping up to date with plugins. I recently was brought in to assist with an upgrade which had an outdated version of WordPress along with over 40 plugins that were out of date. (Yes – 40). While most people often “do not want to rock the boat” with plugin updates – these updates are also essential. Plugins also contain security updates which are important.

If you are serious about your web presence – take some time to update WordPress and the plugins as the updates come out. If you are concerned that an update might break some custom functionality – create a backup first and then update. If anything goes wrong – you can always go back to what you had right before the update. If you do not want to worry about updates – consider moving to a WordPress host like WP Engine – who will take care of WordPress updates for you.

WordPress Update: WordPress 3.4.2 is Available

0

Posted by: jzelazny on September 7, 2012

Categorized: WordPress, WordPress Updates

Tagged: ,

WordPress 3.4.2 is now available for download. This update contains several bug fixes as well as some security updates. It is recommended you updated your version of WordPress to 3.4.2 as soon as possible.

“The vulnerabilities included potential privilege escalation and a bug that affects multisite installs with untrusted users. These issues were discovered and fixed by the WordPress security team.”

For a full list of all issues addressed in this update, please look at the 3.4.2 documentation.

Download WordPress 3.4.2

HOWTO: Add Page Slug to Body Class in a WordPress Theme

1

Even though the body_class() function in WordPress outputs a good deal of classes you can easy use – there are sometimes when having the actual page name as a class is helpful (custom CSS).

Usage Example:

  • Page Named: My Test Page
  • You need the ability to apply some CSS to something only on this page

In your functions.php file – add the following:

/*
 * Add in page nicename to body class
 * @param $classes = array of class names or a string with space-separated classes names
 */
function sdac_body_page_name_class( $classes ) {
	global $post;
		$classes[] = $post->post_name;
	return $classes;
}
add_filter('body_class', 'sdac_body_page_name_class');

Once that function is in place you will then see this on the test page as a class in the body tag: “my-test-page”. With that in place you can then use something like this to make a page specific change in CSS:

.my-test-page .entry {margin:50px 0 100px 0;}

WordPress Update: WordPress 3.4.1 is Available

0

Posted by: jzelazny on June 28, 2012

Categorized: SDAC Blog, WordPress Updates

Tagged: ,

Please make sure to update your WordPress sites to version 3.4.1 which includes both bug and security fixes.

For more information check out the announcement at http://wordpress.org/news/2012/06/wordpress-3-4-1/

HOWTO: Show Admin Bar to Admin Users Only

0

Posted by: jzelazny on June 15, 2012

Categorized: SDAC Blog, WordPress, WordPress Logic

Tagged: , ,

Since WordPress 3.1 – after you log in to a WordPress site – you now see a dark grey bar at the top. If you only want users of a certain role to see it (admins vs. subscribers) you can easily set that up by adding the following code to your functions.php file:

if (!current_user_can('manage_options')) {
	add_filter('show_admin_bar', '__return_false');
}

You can also only show the bar to editors, authors, etc by changing the first line. You can learn more about roles/capabilities: http://codex.wordpress.org/Roles_and_Capabilities

Debugging Errors With WordPress

0

Posted by: jzelazny on June 14, 2012

Categorized: WordPress, WordPress Troubleshooting

Tagged: , ,

Debugging your PHP errors is very easy with just a few lines in your wp-config.php file. By adding the following code to the wp-config.php file – you will turn off displaying the errors to users while logging them to a log file for your review.

define('WP_DEBUG', true); // or false
if (WP_DEBUG) {
  define('WP_DEBUG_LOG', true);
  define('WP_DEBUG_DISPLAY', false);
  @ini_set('display_errors',0);
}

Documentation: http://codex.wordpress.org/Editing_wp-config.php#Configure_Error_Log

*Note from the documentation: The log file will be called debug.log located in /wp-content. You may need to create it with appropriate permissions (666) first if your web server does not have write access.

Hopefully by logging the errors – you can easily debug any issues without having any users see them while browsing the site.

WordPress Update: WordPress 3.4 is Available

1

Posted by: jzelazny on June 13, 2012

Categorized: SDAC Blog, WordPress, WordPress Updates

Tagged: ,

If you have not already updated your site already – check out the latest and greatest version of WordPress: WordPress 3.4. You can see there are a number of changes and some new functionality in place with this latest release.

If you are a developer – you will see a lot of great little additions like the introduction of term_is_ancestor_of(), WP_User::exists(), get_header_image_data(), and more (see the link above). If you are a user – you will also benefit from this release as well with the new theme options, better performance, and embed support to include tweets.

Download WordPress 3.4: http://wordpress.org/wordpress-3.4.zip

HOWTO: Add Custom Classes to Post Navigation Links

0

Posted by: jzelazny on June 12, 2012

Categorized: HOWTOs, SDAC Blog, WordPress, WordPress Logic

Tagged: ,

Sometimes you just need to have a bit more control over the display of the post navigation (next_posts_link, previous_posts_link). You can easily add in your own custom classes by adding the code below to your theme’s functions.php file. In the example below – I added in a custom class “older” and “newer”. You can add in anything there you would like.

add_filter('next_posts_link_attributes', 'sdac_next_posts_link_attributes');
function sdac_next_posts_link_attributes(){
		return 'class="older"';
}
add_filter('previous_posts_link_attributes', 'sdac_previous_posts_link_attributes');
function sdac_previous_posts_link_attributes(){
		return 'class="newer"';
}

HOWTO: Easily Change Registration Redirect in WordPress

0

Posted by: jzelazny on June 10, 2012

Categorized: HOWTOs, SDAC Blog, WordPress, WordPress Logic

Tagged: ,

Ever want to change the redirect for your WordPress site but were not sure how to do it? There is a quick and easy way to accomplish this. Simply put the following code in your theme’s functions.php file and change the URL after the “return”.

add_filter( 'registration_redirect' , 'sdac_registration_redirect' );
function sdac_registration_redirect() {
    return 'http://my-redirect-url.com';
}