How to display the image before the text in WordPress widget?

James Net April 20, 2013
Pinterest Stumbleupon Whatsapp
Ads by Google

Hello my friend,
I read this article on how to create WordPress widgets How To Create Your Own Basic Wordpress Widgets How To Create Your Own Basic Wordpress Widgets Many bloggers will search for the perfect Wordpress widget that will do exactly what they want, but with a little programming experience you may find it's easier to write your custom widget. This week I'd... Read More and it was very useful. I have done all, but I need to show the thumbnail before the text. My code now is:

if (have_posts()) :
echo “”;
while (have_posts()) : the_post();
echo “”.get_the_title();
echo the_post_thumbnail($post_id, ‘medium’);
echo “”;

echo “”;

I have tried to change something, but my WordPress crashes and shows me a white page. Please can you help me? Thank you in advance!

  1. James Net
    April 22, 2013 at 9:34 pm

    the code that i pasted here were missed up, i don't know why, anyway, I have resolve this, please delete it

  2. James Bruce
    April 22, 2013 at 7:06 am

    First up, I'm not sure why you're echoing "" unless the code paste messed up. Those lines are now pointless, so remove them. Second, bit difficult to tell without seeing the full code. Probably you just forgot close the php somewhere, but using pastebin to show us everything would help.