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 »

How to use PHP in Atahualpa 3.6.7


 
Prev Previous Post   Next Post Next
  #1  
Old May 20, 2011, 01:45 AM
sudipto's Avatar
sudipto
 
15 posts · Feb 2011
LetusBuzz.com Powered by Wordpress and Atahualpa
How to use PHP in Atahualpa 3.6.7

This the easiest way to again use PHP in Atahualpa 3.6.7 and later versions.
We will have to edit functions.php file.

Add this below code functions.php file. (Code has been take from Atahualpa 3.5.3)

PHP Code:
function bfa_html_inserts($custom_code) {
    global $bfa_ata; 
    if($custom_code != '') {
        if ( strpos($custom_code,'<?php ') !== FALSE ) {
            ob_start(); 
                eval('
?>'.$custom_code); 
                $custom_code = ob_get_contents(); 
            ob_end_clean();
        }
    } 
    return $custom_code; 
}

Edit function bfa_parse_widget_areas($content)

PHP Code:
function bfa_parse_widget_areas($content) {
                
    if ( strpos($content,'<?php bfa_widget_area') !== FALSE ) {
        $content = preg_replace_callback("|<\?php bfa_widget_area(.*)\((.*)'
(.*?)'(.*)\)(.*)\?>|","bfa_parse_widget_areas_callback",$content);
    }
       $content=bfa_html_inserts($content); /******** ADD THIS LINE *************/
    return $content; 
}

Logic behind the changes
The extra added function evaluates PHP using the eval function.
I have added a call to that function from function bfa_parse_widget_areas because bfa_parse_widget_areas is used to create custom widget areas. So if you can create a custom widget area at a particular place then you will also be able to use PHP in that section.
Still you wont be able to use php in CSS Insert. But now you know how it is done so you can easily figure out how to even use PHP in CSS Insert. You are just require to call bfa_html_inserts function before returning the result

Last edited by sudipto; May 20, 2011 at 01:50 AM.
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Atahualpa 3.6.4 and PHP 5.3.5 --> Stream bfa:// cannot be opened (PHP 5.2.17 works) Jan New Versions, & Updating 0 May 3, 2011 07:15 AM
Atahualpa child theme function php kdawes01 Atahualpa 3 Wordpress theme 1 Sep 23, 2010 03:58 AM
[SOLVED] Stand alone php page on Atahualpa theme catherinehbbh Forum How-To 2 Apr 7, 2010 07:34 PM
PHP Catchable fatal error: themes/atahualpa/functions/bfa_meta_tags.php on line 169 Shamisen Plugins & Atahualpa 0 Apr 6, 2010 10:43 PM
How to edit single.php in atahualpa? Chloe Plugins & Atahualpa 8 Jan 29, 2010 02:58 PM


All times are GMT -6. The time now is 04:44 AM.


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