Wordpress Themes - WP Forum at BFA
There will be no more development for Atahualpa (or any other theme), and no support. Also no new registrations. I turned off the donation system. I may turn the forum to read only if it gets abused for spam. Unfortunately I have no time for the forum or the themes. Thanks a lot to the people who helped in all these years, especially Larry and of course: Paul. Take care and stay healthy -- Flynn, Atahualpa developer, Sep 2021

Wordpress Themes - WP Forum at BFA » WordPress Themes » Atahualpa 3 Wordpress theme » Sidebars & Widgets »

BFA Popular Post Widget with the "display the list on" feature not working?


  #1  
Old Sep 15, 2009, 12:58 PM
cyboc
 
8 posts · Sep 2009
I'm running Atahualpa 3.4.1 on Wordpress 2.8.4 and I'm trying to display the BFA Popular Posts and BFA Recent Comments widgets only on the home page. For both of them, I checked the Homepage checkbox in the "display the list on" section. The BFA Recent Comments widget correctly displays only on the homepage but the BFA Popular Posts widget displays everywhere.

Comparing the code in bfa_recent_comments.php vs bfa_popular_posts.php (both files in the "functions" directory) seems to reveal the reason. bfa_recent_comments.php has an "if" statement that checks for the page you are on:

PHP Code:
if ( (is_home() && $bfa_rc_display_homepage == "on") OR 
(
is_category() && $bfa_rc_display_category == "on") OR 
(
is_single() && $bfa_rc_display_post == "on") OR 
(
is_page() && $bfa_rc_display_page == "on") OR 
(
is_date() && $bfa_rc_display_archive == "on") OR       
(
is_tag() && $bfa_rc_display_tag == "on") OR 
(
is_search() && $bfa_rc_display_search == "on") OR 
(
is_author() && $bfa_rc_display_author == "on") OR 
(
is_404() && $bfa_rc_display_404 == "on")) {
...

I think bfa_popular_posts.php needs similar code except variable names are different. For example, this seems to be what is needed:
PHP Code:
if ( (is_home() && $bfa_pp_display_homepage == "on") OR 
(
is_category() && $bfa_pp_display_category == "on") OR 
(
is_single() && $bfa_pp_display_post == "on") OR 
(
is_page() && $bfa_pp_display_page == "on") OR 
(
is_date() && $bfa_pp_display_archive == "on") OR       
(
is_tag() && $bfa_pp_display_tag == "on") OR 
(
is_search() && $bfa_pp_display_search == "on") OR 
(
is_author() && $bfa_pp_display_author == "on") OR 
(
is_404() && $bfa_pp_display_404 == "on")) {
...

While we are on the topic, it would be nice to have a "BFA Recent Posts" widget with similar "display only on" logic.
  #2  
Old Sep 15, 2009, 03:48 PM
cyboc
 
8 posts · Sep 2009
Quote:
Originally Posted by cyboc
I think bfa_popular_posts.php needs similar code except variable names are different. For example, this seems to be what is needed:
PHP Code:
if ( (is_home() && $bfa_pp_display_homepage == "on") OR 
(
is_category() && $bfa_pp_display_category == "on") OR 
(
is_single() && $bfa_pp_display_post == "on") OR 
(
is_page() && $bfa_pp_display_page == "on") OR 
(
is_date() && $bfa_pp_display_archive == "on") OR       
(
is_tag() && $bfa_pp_display_tag == "on") OR 
(
is_search() && $bfa_pp_display_search == "on") OR 
(
is_author() && $bfa_pp_display_author == "on") OR 
(
is_404() && $bfa_pp_display_404 == "on")) {
...

Yup, my little hack shown above works! I put it in function widget_mdv_most_commented, just below the line global $wpdb;. Don't forget to add the closing "}" at the bottom of that function to close the if statement.
  #3  
Old Sep 15, 2009, 03:52 PM
cyboc
 
8 posts · Sep 2009
Quote:
Originally Posted by cyboc
While we are on the topic, it would be nice to have a "BFA Recent Posts" widget with similar "display only on" logic.
Another nice to have would be "BFA Upcoming Posts" widget, again with "display only on" logic. I guess it would be similar to the Upcoming Posts plugin but with BFA's "display only on" logic. Basically, it should display the titles of future-dated posts (i.e. posts that haven't been published yet).

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
"Popular Posts" Plugins Not Working NealSchaffer Plugins & Atahualpa 3 Mar 8, 2010 11:10 AM
How to Display certain "Widget Area" on post pages only ? 3ukman Sidebars & Widgets 1 Jul 15, 2009 03:08 PM
[SOLVED] "BFA Popular Posts" still showing up SS3 Sidebars & Widgets 2 Jun 12, 2009 08:12 AM
Flexx theme - How to change my "List Category or Archives" to "List Titles ONLY" ?? idaks01 Post-Kicker, -Byline & -Footer 0 Mar 28, 2009 05:22 PM
"Widget List Items" Settings Are Not Persisted bseppa Sidebars & Widgets 1 Dec 13, 2008 12:34 PM


All times are GMT -6. The time now is 03:21 AM.


Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.