Fixing a Problem with WordPress Trackbacks and Pingbacks

Trackbacks and pingbacks stopped working on several of my blogs. It turned out to be quite time consuming figuring out what was causing the problem. Eventually the following worked:

Installing php-xml

sudo apt-get install php-xml

And commenting out a check for empty $context variable (this doesn’t really make sense as the variable isn’t empty at this point but until it was commented out it just silently didn’t work) in the file wp-includes/class-wp-xmlrpc-server.php.

// if ( empty($context) ) // Link to target not found
// return $this->pingback_error( 17, __( 'The source URL does not contain a link to the target URL, and so cannot be used as a source.' ) );

Anyway if the initial steps you take to deal when trackbacks and pingbacks on your blog stop working you might want to try these steps that worked for me.

Related: Fix for When a WordPress Blog Stops Displaying ImagesCompare WordPress Files on Server to Proper WordPress VersionWordPress: Multiple Blog Network on One Server – Overcoming Conflicts

WordPress error: Image could not be processed. Please go back and try again.

If you get an error saying

Image could not be processed. Please go back and try again.

when you try to put a new custom header image for WordPress theme 2010 on a server using Ubuntu the following may help:

apt-get install php5-gd

once it installs then

invoke-rc.d apache2 restart

This will provide php the ability to manipulate images that WordPress is trying to use.

Using Git and Github

To download a repository hosted on github

git clone git@github.com:account_name/repo_name.git

The git@github.com:account_name/repo_name.git will be shown on the home page for the repository on github.com

To update your code from the master branch of the repo:

git pull origin master

To commit the changes you have made locally:

git commit -m "the message explaining what these code changes did"

To send your changes to the repo at github:

git push origin master

Code to Display text only on WordPress Blog Home Page

Cut and past php code to determine if it is the wordpress blog home page (and only the home page itself).

<?php if (is_home() && !is_paged()): ?>

Example, to print john if it is a “homepage” templated page and jill otherwise:

<?php if (is_home(); ?>

<?php
  if($name == 'john'){
    echo 'Hi John';
  }else if($name == 'jill'){
    echo 'Hi Jill';
  }else{
    echo 'Hi';
}
?>