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 » New Versions, & Updating »

The code needed to customize location of header images


 
Prev Previous Post   Next Post Next
  #1  
Old Feb 3, 2013, 07:08 PM
geir
 
2 posts · Jan 2012
The code needed to customize location of header images

I have to agree with a lot of the arguments put forth by noel.odesk in the now closed thread Why I Hate Upgrading Atahualpa.
Now, php is not my native language, but from what I can see, these are the code changes needed to introduce a theme option for specifying the location of the header image files. This will allow the header images to be put in a directory that survives a theme upgrade. Incorporating these few lines of code into an otherwise excellent theme would make life a little bit easier for quite a few of the ATA users out there.

File: functions/bfa_theme_options.php
Code:
(...)
                        common today, so the images should be that wide or wider. The next common screen widths are 1440, 1600, 1680 and
                        1920 pixels. </li></ul>" . $header_image_text),

+     array(    "name" => "Header Images Directory",
+             "category" => "header-image",
+             "id" => "header_images_dir",
+             "std" => "images/header",
+             "type" => "text",
+             "info" => "Directory for header image(s), relative to Atahualpa theme directory. No leading or trailing slashes."),
+
     array(    "name" => "Rotate header images with Javascript?",
            "category" => "header-image",
             "id" => "header_image_javascript",
(...)
File: functions/bfa_get_options.php
Code:
(...)
                        "allow_debug",
                        "IEDocType",
+                       "header_images_dir",
                        "overlay_header_image"
                        );
(...)
File: functions/bfa_rotating_header_images.php
Code:
(...)
                ################### images in /images/header/ (on regular WordPress)

                $files = "";
-               $imgpath = get_template_directory() . '/images/header/';
-               $imgdir = $templateURI . '/images/header/';
+                if(isset($bfa_ata['header_images_dir'])) {
+                        $imgpath = get_template_directory() . '/' . $bfa_ata['header_images_dir'] . '/';
+                        $imgdir =  $templateURI . '/' . $bfa_ata['header_images_dir'] . '/';
+                } else {
+                        $imgpath = get_template_directory() . '/images/header/';
+                        $imgdir = $templateURI . '/images/header/';
+                }
                $dh  = opendir($imgpath);

                while (FALSE !== ($filename = readdir($dh))) {
(...)
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Is there a way to customize the location of image directory flyboy Header configuration & styling 1 Jul 2, 2011 11:51 AM
[SOLVED] Widget Areas Needed to run adsense code in header? webgurl Sidebars & Widgets 3 Dec 4, 2010 02:56 PM
Location for php code for SOCIABLE widget? strangelove Post-Kicker, -Byline & -Footer 1 Feb 18, 2009 06:04 PM


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


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