WordPress Training: Vanishing Content

25 Feb

This is an issue I helped a fellow blogger out recently with content that she was trying to embed in a post in her blog, but for some reason it was not appearing in her post.

I had her send me the embed code and took a look at the code. Here’s a sample:

The code above poses a few issues for WordPress as there are a few things we have to take into account.

Your WordPress theme will have a layout for posts defined and the above code adds in a couple of divisions which are identified by the <div> tags. The div tags really aren’t necessary to display the video inside the post, and as such, we will remove them.

Once we remove them, you are left with the embed code below:

Now the code above has some issues with it as well, as your WordPress theme should be the one determining where the video sits in your post and what size it is. So in the code where you see style= is modifying the display of the video within the post.

What we need to do next is remove everything from the style except for the height and width.

 

The code above is now what we’re left with. 100% width means that the content will fill the available width of the post. Height can’t be 100% as it just doesn’t work 90% of the time. So for height I just picked an arbitrary width of 500 pixels wide but really this can be almost any number.

The product of the code above is below:

and there you have it! A working video!

WordPress “Designers”

17 Sep

wordpress-logo-simplified-rgbThere’s something I’ve really been getting sick of lately and that is WordPress “Designers” who say that something can’t be done when in fact it can be done and is quite simple.

Quite a few of these so called designers are simply people who take an existing wordpress theme, and use the Customizer to make it look the way their client wants. They do not actually go through the motions of designing a WordPress theme.

I had a client ask me about making the thumbnails on her archives page square and not distorting the images by resizing them to 180 x 180. This is fairly simple to do however their “designer” told them it was not possible. So for that “designer”, I’ve provided a code sample as to how I did it.

This creates a div using the post image as the background image and makes the div 180 x 180. Using the background-size cover means the image will be draped over the div and not constrained to it. The result is exactly what the client asked for and took about 10 minutes to perfect.

So if you’re a “designer” you may want to learn how HTML and CSS work so that you can actually help your customers and not just take their money.

White Page After Adding or Updating a Post? Check your plugins!

25 Jul
wordpress-logo

When you host a lot of WordPress sites, you never stop learning about WordPress and the common issues that WordPress authors run into.

WordPress does one thing really well. It allows people to get a blog up and running in a few minutes with absolutely no knowledge of HTML, CSS, PHP, or MYSQL which is both a good and bad thing. Good because blogs are all about writing. Bad because if you don’t know much about how the underlying system works, then you can run into issues.

One such issue I worked on yesterday. A customer was having an issue with saving and updating posts and being directed to a blank screen afterwards.

After following the standard “Deactivate all plugins and activate them one by one” I found the culprit. It was a plugin called “Social Networks Auto Poster (S.N.A.P)” that was having problems.

Screen Shot 2014-07-25 at 10.01.11 AM

Apparently this plugin requires a minimum of 40MB of ram to be allocated to PHP to even function properly. After updating the customers PHP.ini and allowing a bit more RAM, then issue disappeared.

In my clients case, we allow more RAM to be allocated to PHP as necessary however many hosts allow a maximum amount of RAM and do not allow for higher RAM usage than their maximum. So in this case it could be fixed however in the case of other hosts, they would simply tell you to get rid of this plugin.

I hope you enjoyed the first post in this series, and I look forward to writing more and more as I encounter different bugs in WordPress themes and plugins.