Advanced: Conditional Widgets
Quote:
This is not for beginners, but with some basic PHP knowledge, it is doable, and there are several ways, but I'll Dick and Jane it as best as I can. For starters, I'd recommend you read this thread and this post. I made a sample like you described, and randomly made widget 2 empty half the time. In real life, if you were going to use this, you'd probably have functions building the widgets with conditions, which would or could result in an empty widget (otherwise you wouldn't need this technique). First, in my template, I put: HTML Code:
<?php dynamic_sidebar( 'footer-widgets' ); ?> HTML Code:
<?php echo custom_make_footer_widgets(); ?> PHP Code:
|
I'm new to wordpress so could you post your full code and a link to an example where you have implemented this? I'd like to see it in action
|
This isn't a newbie technique (notice the first word of the thread title).
This post shows what I've implemented to far, and the links in that post show the howtos for various things. You'll find on this forum that you're more likely to get concepts you can customize, use, and apply than you are to get copy and paste code -- fishing lessons rather than fish. |
well can you point to a site showing it in action? it sounds interesting and I'd like to see it in action.
|
This post shows a lot of things made with custom php. The links in it show lots of other possibilities, including lots of conditions. You'll need to at least understand the two links in the first post on this thread to do any of this.
I posted this thread in response to an original poster who asked how to do have conditional widgets, and I asked him to post his results. Hopefully, he will soon, and you'll be able to see his implementation. Check back later. |
Quote:
I have also edited the original post with all the code I used. |
All times are GMT -6. The time now is 10:02 AM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.