Archive for the ‘ Wordpress ’ Category

WordPress one-click installer up to 4.5.2

Posted by

We’ve updated our WordPress one-click installer to automatically install WordPress 4.5.2.

Your customers will now have the latest version of WordPress right away, with no need to update their fresh installations.

Please make certain that your current WordPress-using customers have updated their WordPress, as the most recent update fixed major security issues.

One Click Installation of WordPress

Posted by

WordPress is arguably the most popular blogging software available today! It’s easy to install and will allow you to have a great looking, easy to use blog in minutes.

Version 3 allows you to choose to install a single blog or to have multiple WordPress blogs on a single website. Multiple blogs are more demanding on the administrator than a single blog so if you plan just a single blog choose that option.

1. Login to your control panel through www.extendcp.co.uk

2. Scroll down to CGI Scripts and click on WordPress Blog.

Screen Shot 2014-06-05 at 19.49.41

3. Either enter the directory that you want WordPress installed to or if you want it installed to the root of your domain simply leave this field blank.

Screen Shot 2014-06-05 at 19.49.58

4. Click Install Now

5. After around a minute WordPress will be installed and when you go to the URL that you installed WordPress on you will be able to run through the initial configuration.

If the installation gave an error its most likely because the directory you tried to install in was not empty. If you still get stuck feel free to contact Switchweb support.

WordPress Feed Invalid Char

Posted by

When you open your WordPress sites RSS feed in the browser you get the following error:

“WordPress Feed Invalid Char”

The error will also show you the the line number of the error.

View the source of the feed and go to the line of the error. Find the corresponding post in your WordPress admin.

Copy the title and body into notepad (note this will remove all formatting).

You will be able to see the non UTF8 characters in notepad and be able to delete them. You can then copy and paste the problem text back into WordPress.

The offending characters won’t show in the WordPress admin hence having to copy into notepad.

WordPress Pages & Posts not showing

Posted by

If when you load the wordpress admin none of your pages & posts are showing, do the following:

  1. Edit wp-config.php and add
    define('WP_ALLOW_REPAIR', true);
    
  2. Open the database repair URL
    HOSTNAME/wp-admin/maint/repair.php

This should force an upgrade of the database. Remember to remove the line from wp-config after running the upgrade.

Find Most Recent Comments

Posted by

To find the most recent comments in WordPress use the following code:


$number=30; // number of recent comments desired
$comments = $wpdb->get_results("SELECT * FROM $wpdb->comments WHERE comment_approved = '1' ORDER BY comment_date_gmt DESC LIMIT $number");
if ( $comments ) : foreach ( (array) $comments as $comment) :
echo sprintf(__('%1$s on %2$s'), get_comment_author_link(), '' . get_the_title($comment->comment_post_ID) . ' - ') . $comment->comment_date;
endforeach;
endif;

Find the most recent posts from a specific category

Posted by

In WordPress sometimes you will want to show the most recent post from a specific category.

To do this use the following code:


global $post;
//change the category=1442 to the category number you want to pull the content from
//change numberposts=1 to the number of posts you want to return from the category
$myposts = get_posts('numberposts=1&category=1442&order=DESC');
foreach($myposts as $post) :
setup_postdata($post);
$catpost= " ". get_the_title() ."";
endforeach;

echo $catpost;

Store the_permalink() as a variable

Posted by

The wordpress function the_permalink() automatically echos the content to the screen.

Sometimes you want to store this value in a variable.

In this case use:


$string = get_permalink();