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:
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! |
you got it, plugins can use the eval() function, but themes can not...strange but true.
|
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:
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? |
can you export you theme settings and attach them to a reply ato->export/import settings
|
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. |
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. :o
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 Code:
PHP Code:
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. |
Oops. Thought I could send via PM. I'll try attaching here.
|
so I think this will work. Lets take the example of what you have in the 'KICKER: Single Post Pages'
HTML Code:
<div class="breadcrumbs"> HTML Code:
<div class="breadcrumbs"> HTML Code:
<?php HTML Code:
<?php if( function_exists('ADDTOANY_SHARE_SAVE_KIT') ) { ADDTOANY_SHARE_SAVE_KIT(); } ?> |
Thanks, Juggledad.
The theme parameter %wp-print% requires the plug-in WP-print which has the following in their documentation: Quote:
|
All times are GMT -6. The time now is 01:23 AM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.