Wordpress Themes - WP Forum at BFA
Click Here To DONATE! Support the theme development, get more attention and additional benefits based on your donation level. Your forum name will be highlighted.

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?


Build custom WP THEMES, without
coding.
Click here for THEMEFRAME

From the author of Atahualpa, the #1 most
downloaded (700,000+) theme @ wordpress.org
  #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 09:52 AM.


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