How To Add Widgets In Your WP Blog Via PHP File Editing

Many people who use WordPress have themes that are not widget friendly, but unfortunately at some point you’ll have a hard time finding a fix for it. But the good news is that there is a way around it and I am about to show you how you can make almost any widget appear on your site without using the widget options. So let’s begin! Let me say first that you do not need much if any PHP/HTML or CSS knowledge for this and it is really simple to do. Also, this is for self-hosted WP blogs, not wordpress.com blog since they do not allow you to edit your theme files.
First find the widget that you wish to use on your sidebar and copy the code. You can use the short cut of control(ctrl) and c.
Then go on your WP admin and go to your theme editor, which will be listed under appearance menu.
Then go to your sidebar.php file and locate which area you want the widget on. Most themes use two columns, so be sure to pay attention to which column you will put it under.
Paste it using the ctrl and v combo. In the photo above, you see the blue area is the new code that I just pasted. After that is done, click on the save update. Be sure to know where you pasted the code or back up your sidebar.php file in case of errors before hand.
After you updated the file, you should see a banner that says “file edited successfully“. Then click on your visit site button on the top of your WP dashboard.
Look for the location of the widget that you just installed. If you find it and it appears to fully work, you have successfully added a widget to your layout via PHP. If not, go back and see what you did wrong and make the proper edits as needed.
Let me know if you have any questions or want more info.
Both comments and pings are currently closed.

Comments are closed.

Powered by WordPress | Designed by: video games | Thanks to game news, game reviews and game blogs