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 » Plugins & Atahualpa »

Enhanced text widgets and PHP plug-ins


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 Jun 6, 2011, 12:29 PM
ArtG
 
25 posts · Apr 2011
Enhanced text widgets and PHP plug-ins

Just want to check a few assumptions I am making before implementing the enhanced text widget solution for 3.6.7+

1) Because such widgets have not been removed from WP's Plug-in Directory, placing PHP in these widgets resolves the following matter which prompted the removal of our being able to use PHP within theme options. from BFA homepage:

Quote:
No custom PHP code anymore: After the “Eval” function was not permitted anymore in themes, the alternative “stream wrappers” caused issues on all hosts where Suhosin was installed. The remaining option “temp. files” isn’t an option either because that requires file operations again. Atahualpa was one of few themes, if not the only one, to offer the ability to add custom PHP through theme options. This is not possible anymore in themes listed on wordpress.org. There might be workarounds or even alternative theme options in the near future, here or on the forum.

2) The removal of being able to add PHP through the theme options does not impact the ability to add PHP to a page or post when using a plug-in like Exec-PHP.


Thanks!
  #2  
Old Jun 6, 2011, 12:50 PM
juggledad's Avatar
juggledad
 
21,980 posts · Mar 2009
OSX 10.8.5 WP 3.8.x Atahualpa 3.7.x Safari 6.x Firefox 25 XP
you got it, plugins can use the eval() function, but themes can not...strange but true.
__________________
If you like my help, please consider donating. I am happy to provide greater detail on this and other topics if you hire me. Please send detailed support requests to me as a private message, thank you.
Juggledad | Forum Moderator/Support
  #3  
Old Jun 7, 2011, 03:16 PM
ArtG
 
25 posts · Apr 2011
Juggledad, your tips and assistance have been very helpful. Just sent something your way via PayPal to say thanks.

Seems I can't use the text widget approach since I can't add a new widget area to locations where I am using PHP: multi- and single-post kickers, bylines, and footers. So I looked around elsewhere on this forum, as well as in the codex and in Atahualpa's code, and have come up with the following idea. Any feedback, tips, or alternative ideas you might have would be most welcome.

Problem to solve: no longer able to use PHP to create custom kicker/byline/footer format and content for different types of posts.

Solution:create a child theme that contains just two files, the required style.css which simply imports Atahualpa's style.css, and a functions.php containing...

PHP Code:
function new_bylines() {
    
$single_by //code from ATO single-post byline goes here;
    
return apply_filters 'post_byline_single' $single_by );
    
$multi_by //code from ATO multi-post byline goes here;
    
return apply_filters 'post_byline_multi' $multi_by );

...which would be revised and repeated to do the same thing for the 'hooks' post_footer_single, post_footer_multi, post_kicker_single, and post_kicker_multi which are found in bfa_post_parts.php.

Would this work? If so, can I literally copy what I have in ATO fields, such as post info items which contain %, into these functions? Is there an easier way?

Last edited by ArtG; Jun 7, 2011 at 04:03 PM.
  #4  
Old Jun 7, 2011, 04:21 PM
juggledad's Avatar
juggledad
 
21,980 posts · Mar 2009
OSX 10.8.5 WP 3.8.x Atahualpa 3.7.x Safari 6.x Firefox 25 XP
can you export you theme settings and attach them to a reply ato->export/import settings
__________________
If you like my help, please consider donating. I am happy to provide greater detail on this and other topics if you hire me. Please send detailed support requests to me as a private message, thank you.
Juggledad | Forum Moderator/Support
  #5  
Old Jun 7, 2011, 04:35 PM
juggledad's Avatar
juggledad
 
21,980 posts · Mar 2009
OSX 10.8.5 WP 3.8.x Atahualpa 3.7.x Safari 6.x Firefox 25 XP
actually I just tried creating a new widget area in the kicker and it works. Did you try it?

because the code can get parse ad it knows about the bfa_widget_area() function, it can parse that code, it just can't parse other php, like if statements etc.
__________________
If you like my help, please consider donating. I am happy to provide greater detail on this and other topics if you hire me. Please send detailed support requests to me as a private message, thank you.
Juggledad | Forum Moderator/Support
  #6  
Old Jun 8, 2011, 07:42 AM
ArtG
 
25 posts · Apr 2011
I was able to create a widget area in the kicker - but only after I actually upgraded to 3.6.7 on my test site.

After doing so, and making sure the standard text widget could use php through the plug in Exec-php, I was able to enter this into the text box in my kicker widget area...

PHP Code:
<?php if( function_exists('ADDTOANY_SHARE_SAVE_KIT') ) { ADDTOANY_SHARE_SAVE_KIT(); } ?>
...and get the desired results. I then added some logic...

PHP Code:
<?php 
if ( 0) {
 Echo 
"<b>Tell your friends: </b>";
 if ( 
function_exists('ADDTOANY_SHARE_SAVE_KIT') ) { ADDTOANY_SHARE_SAVE_KIT(); } }
else {
 Echo 
"<b>Why do I see this?</b>";
}
?>
...and was surprised to see I got exactly what I wanted. However, even though this is in the kicker, when adding a post info item into the mix...

PHP Code:
<?php 
if ( 0) {
 Echo 
"<b>Tell your friends: </b>";
 if ( 
function_exists('ADDTOANY_SHARE_SAVE_KIT') ) { ADDTOANY_SHARE_SAVE_KIT(); } }
else {
 Echo 
"<b>Why do I see this?</b>";
}
?>
<b>You are here: </b>%category%
...I would get %category% regardless of any combination of the above that crossed my mind.

As requested I am sending a copy of my theme settings via PM. This is from the 3.6.4 version but I doubt that matters given I assume you are looking at the php I am placing in the multi- and single- kicker, byline, and footer fields. I am also including a few PDFs of the actual site pages showing the results we want using 3.6.4.

I realize now some of my php logic could be simplified by retrofitting the site with custom posts and using their ID numbers instead of content fields from the posts and I will make those changes. Just not sure how to solve the issue surrounding post info items.

Last edited by ArtG; Jun 8, 2011 at 07:48 AM.

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Audio - MP3 File - blip.tv - plug ins eager to learn Plugins & Atahualpa 1 Jun 2, 2010 03:29 AM
Lightbox/Featured Content Plug-Ins for Atahualpa writeleft Atahualpa 3 Wordpress theme 1 Apr 2, 2010 08:49 AM
Widgets page and plug ins add page not working, and displaying differently shamrock 2000 Sidebars & Widgets 10 Feb 16, 2010 04:19 PM
Analytic Type Plug Ins/Issues/Questions jfrenaye Plugins & Atahualpa 2 Oct 5, 2009 05:59 PM
Using Page2Cat with SmoothGallery plug-ins... gallery not working? harpek Plugins & Atahualpa 2 Aug 2, 2009 08:25 PM


All times are GMT -6. The time now is 07:08 AM.


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