I have been trying to learn how to make my own custom WordPress sidebar widgets because every theme uses their own custom layout and I prefer a specific layout which I can only acomplish by manually editing the WordPress theme sidebar PHP file. In this post I will show you how to make your own custom sidebar widget style entry with my “Recent Updates” widget as an example. First you need to navigate to your themes sidebar.php file which is located in the admin section under Appearance/Editor. Find the sidebar.php file and select it for editing. In the main window you should see each chunk of code which will represent each section on your sidebar menu. Every theme is different and the way people choose to write their code is different as we have gone over in the past so its up to you to make minor adjustments to make this work. Once you find a good spot for your new widget we will need to paste in this chunk of code. This is my
I searched for a while on how to do this and finally think I figured it out but it still needs to be tweaked. First you need to create your custom queries, I have created 2 here which pull from different categories. I searched for a while on how to do this and finally think I figured it out but it still needs to be tweaked. First you need to create your custom queries, I have created 2 here which pull from different categories. Replace With After the loop is finished (somewhere around the endif / or equivalent) Add Then copy and paste your entire loop but modify your initial query so it now reads your second custom query.
While trying to figure out how I could show posts from two categories but always keep one category on top I finally gave up. The best I could find was to run multiple custom queries using rewind_posts() but even this was difficult to carry from theme to theme as I changed my mind quite often. What I finally decided on was to exclude specific posts on the home page while keeping my sticky at the top and in the side bar I would query post from a specific category. First I began searching how to use wp_get_archives to show posts from a specific category but later realized I was going about it the wrong way and needed to be using something a little more complex but was willing to bet I could find a good example and that I did. I will share the example with you here so you can modify it as I have to replace the customization lacking wp_get_archives function. While trying to figure out how I could show posts from two
This post will explain the proceedure to show posts only from specifc or multiple categories on your WordPress home page. Enter the Admin section of your WordPress site then go to the Appearance => Editor =>. From the right select home.php (if it exists) or index.php (if home.php does not exist). You will want to add code directly above “The Loop” I have found several ways to do this but only a few have worked for me. I will list them below. I have found this to be the most reliable way of doing this. I have revised this post and removed the others. If you dont want to show posts from a specific category simply change the code to negative category For more information on showing specific categories and even specific posts on the home page please check out the following link. WordPress Query Posts If you would like to show 2 or more categories and keep a specific category or post on top please see this link. Word press multiple loops Here is