Default Artisteer footer adminIn the newer versions of Artisteer they have provided a footer link option in the Appearance panel for your theme. The image on the left is what you get by default. This was a great addition and made life a bit easier for folks that didn’t like to edit their source files. But something seemed to be missing. So being the curious guy that I am, I started to poke around in the functions.php file. And what did I find? I found the missing link to making your Artisteer themes more user friendly especially if your building sites for other users.

green-envy-adminNow you can expand the admin panel to as far as you’d like and add an almost unlimited array of options. Check out the image at the right. That’s the admin options for a new Artisteer generated theme that I’m just finishing up.

Well, let’s get started. I would probably rate this as a moderate level of difficulty. As long as you know how to edit your source files, know to make backups and don’t panic when things melt down you’ll be OK.

For this example we’ll be adding some code that will add a 468×60 ad in the right side of our header. We’ll add a small bit of PHP code and some CSS to get to display in the proper area of the header.

Find this bit of code in your functions.php file…

$themename = "Artisteer Test";
$shortname = "artisteer";
$default_footer_content = "<a href='#'>Contact Us</a> | <a href='#'>Terms of Use</a> | <a href='#'>Trademarks</a> | <a href='#'>Privacy Statement</a><br/>Copyright &copy; 2009 ".get_bloginfo('name').". All Rights Reserved.";
$options = array (
array(  "name" => "HTML",
"desc" => sprintf(__('<strong>XHTML:</strong> You can use these tags: <code>%s</code>', 'kubrick'), 'a, abbr, acronym, em, b, i, strike, strong, span'),
"id" => "art_footer_content",
"std" => $default_footer_content,
"type" => "textarea"),

Yours may be slightly different but will have all of the same elements. What we want to do is add some additional selections and variables to use in our theme. Plus we’ll clean up the style a little and add a new title to the option.

The first thing is in line #2 $shortname = “artisteer”, the word in parenthesis can be changed to anything you want as it doesn’t appear to be used anywhere at the moment although it may in the future but that wont matter for now. If you want to change it you can.

Next, we want to put a comma at the end of line #9 above (if you don’t already have a comma there). I discovered this the hard way. You’ll get an error if it’s not there. After you put the comma in place hit carriage return a couple of times so that we have room to insert the next bit of code.

Now insert this in between line 9 & 10 from above…

array(    "name" => "468x60 Header Banner Ad Settings",
"type" => "heading",
"desc" => "You can specify ads (google ad/affiliate ad/banner) on this section. The ad will be displayed as 468x60 Header Banner."),

array(    "name" => "468x60 Banner Ad",
"id" => $shortname."_home_ad_468",
"std" => "Enter 468x60 Ad Code Here",
"type" => "textarea"),

The first array gives us our heading styled section and the second array defines our variable and the type of input we want. In this case a text area for our banner code.

You can add as many different sections as you want as long as you are defining new variables. You can have text areas, check boxes, radio buttons and single text lines.

Now we’ll add the code to the header to display our new ad block. Save your functions.php file and open your header.php file.

Find this bit of code…

<div>
<div></div>
<div>
<h1 id="name-text">
<a href="<?php echo get_option('home'); ?>/"><?php bloginfo('name'); ?></a></h1>
<div id="slogan-text">
<?php bloginfo('description'); ?></div>
</div>

</div>

Again, yours may be slightly different. What we want to do is put our new code after the closing div for the logo and before the closing div of the Header. In this example we would put it starting at line #9.

Here’s the code to put starting at line #9…

<div class="header-ad">
<?php echo stripslashes(get_option('artisteer_home_ad_468')); ?>;
</div>

On line two you want to put your shortname if you changed it from “artisteer”. Now all we have to do is ad a little CSS to get our add to appear in the right place. My example is based on a header of 125px high and I want it on the right side. You can play with the CSS and move things around to suit your theme.

Here’s the CSS to add at the end of your style.css file…

.header-ad	{
float:left;
margin-top:35px;
margin-right:10px;
margin-bottom:0;
margin-left:516px;
height:70px;
}

That’s it. You should now have an expanded admin panel. Experiment by adding new options to your theme. I’ll be releasing a new theme called Green Envy that will have a whole load of options that you can turn off/on with a number of ad and video blocks. So check back in a few days, I just have to clean up a few things and it will be ready to go.

If you have any questions or need some help, just leave a comment and I’ll do what I can to help you out.

Disclaimer

I make no promises as to the functionality of these modifications to your theme code. Do it at your own risk. Do it on a backup copy. Do it while wide awake and after having plenty of sleep or plenty to drink, your choice. Don’t do it to your original code. Don’t do it while sleepy, cranking, or driving. And most important, don’t expect it to work the first time. If it does work the first time you probably got lucky. Besides, if you don’t break things you never figure out how they work. And last but not least…Have fun and learn something new.

  • William says:

    Thought provoking post. Very interesting and enjoyed it alot.

  • Neil says:

    Ah – at last! I’ve been trying in vain to work this out for ages. Wish it was a little simpler mind. Thanks.

  • it should be nice to be able to include this kind of code in the form of embedded code in artisteer itself (of course we must be responsible for putting proper code)

  • Mike says:

    Cool
    just a quick note …about changing the artisteer as noted in this line.
    On line three you want to put your shortname if you changed it from “artisteer”.

    Shuld the three be line two

  • joel says:

    Could you explain where thw footerlink is in the artisteer screen, i am using the latest version (on drupal themes) and do not see such an option.

    Kind regards,

  • admin says:

    Drupal admin is done completely different than WordPress, so this wouldn’t apply.

  • Gary Arctic says:

    I spent about 2 hours trying to code this myself, i should of just googled it sooner since it took about 2 minutes to actually implement it

  • Thanks for this info. I have just downloaded the demo version of Artisteer to try it out but am looking to see what it can really do which is how I found your site. I can see I will be buying the full version.

  • Lars Ahnland says:

    I do exactly as you say above with the function.php, putting comma in the end of line 9 and inserting the code beneath, but get this message:

    Parse error: syntax error, unexpected ‘;’, expecting T_PAAMAYIM_NEKUDOTAYIM in /hsphere/local/home/stereoviewer/fa-news.com/wp-content/themes/financial_activist_news7/functions.php on line 30

    Now, I can’t even axcess my blog, and neither can my visitors! HELP!

  • Lars Ahnland says:

    Pew, I at least got my blog back, removing the lines I inserted through ftp. But still, what am I doing wrong? This is my first 32 lines in my functions.php:

    true,
    ‘menu.homeCaption’ => “Home”,
    ‘menu.showHome’ => true,
    ‘menu.topItemBegin’ => “”,
    ‘menu.topItemEnd’ => “”,
    ‘menu.source’ => “Pages”,
    ‘vmenu.showSubmenus’ => true,
    ‘vmenu.simple’ => false,
    ‘vmenu.source’ => “Categories”,
    );

    $themename = “financial activist news7″;
    $shortname = “artisteer”;
    $default_footer_content = “Contact Us | Terms of Use | Trademarks | Privacy StatementCopyright © 2010 “.get_bloginfo(‘name’).”. All Rights Reserved.”;

    $options = array (
    array( “name” => “HTML”,
    “desc” => sprintf(__(‘XHTML: You can use these tags: %s‘, ‘kubrick’), ‘a, abbr, acronym, em, b, i, strike, strong, span’),
    “id” => “art_footer_content”,
    “std” => $default_footer_content,
    “type” => “textarea”),
    );

    function art_update_option($key, $value){
    update_option($key, (get_magic_quotes_gpc()) ? stripslashes($value) : $value);
    }

    • admin says:

      I just copied the code from above into a new Artisteer v2.4 theme and it worked just fine. Unless something didn’t go properly when you did the copy & paste of the code. It doesn’t take much to cause things not to go crazy. I’ve used this code many times and it does work.

      Also you should never ever make mods on a live site because you never know what’s going to happen. Something as simple as missing a semi-colon can cause your site to crash.

      Everyone that plays around with WordPress should be running a local WAMP or ZAMP server to do all the testing before going live.

  • Lars Ahnland says:

    Great tips on WAMP/ZAMP.

    Is this the way the code (functions.php) should look?:

    ‘menu.homeCaption’ => “Home”,
    ‘menu.showHome’ => true,
    ‘menu.topItemBegin’ => “”,
    ‘menu.topItemEnd’ => “”,
    ‘menu.source’ => “Pages”,
    ‘vmenu.showSubmenus’ => true,
    ‘vmenu.simple’ => false,
    ‘vmenu.source’ => “Categories”,
    );
    $themename = “financial activist news7?;
    $shortname = “artisteer”;
    $default_footer_content = “Contact Us | Terms of Use | Trademarks | Privacy StatementCopyright © 2010 “.get_bloginfo(’name’).”. All Rights Reserved.”;
    $options = array (
    array( “name” => “HTML”,
    “desc” => sprintf(__(’XHTML: You can use these tags: %s‘, ‘kubrick’), ‘a, abbr, acronym, em, b, i, strike, strong, span’),
    “id” => “art_footer_content”,
    “std” => $default_footer_content,
    “type” => “textarea”),

    array(    ”name” => “468×60 Header Banner Ad Settings”,
    “type” => “heading”,
    “desc” => “You can specify ads (google ad/affiliate ad/banner) on this section. The ad will be displayed as 468×60 Header Banner.”),

    array(    ”name” => “468×60 Banner Ad”,
    “id” => $shortname.”_home_ad_468″,
    “std” => “Enter 468×60 Ad Code Here”,
    “type” => “textarea”),
    );
    function art_update_option($key, $value){
    update_option($key, (get_magic_quotes_gpc()) ? stripslashes($value) : $value);
    }

  • Matrix says:

    How is it possible that you provide this info exactly on the moment I want to learn this?
    Great tutorial (bit tough do, as I am Dutch)..

    Bookmarked this page and will be reading more…

    Thanks a lot!

  • Thanks for the article! I searched for a code like that for months!

  • Nehem says:

    I really like this. Its very helpful. But wondering if there is any demo to download.

  • babor_7uiu says:

    It’s a great information for me. Thanks for sharing

  • Dave says:

    Thanks this is just what i was looking for! One question. How difficult would it be to change the footer link panel name so it would display some thing like ‘Theme Options’ instead of ‘Footer’.

    Thanks in advance.

    • admin says:

      Look for this code in the functions.php file…

      add_theme_page(“Footer”, “Footer”, ‘edit_themes’, basename(__FILE__), ‘art_admin’);

      Change ‘Footer’ to whatever you want.

Awesome Themes



Genesis Framework for WordPress

Favorite Random Quotes

“My wife is always trying to get rid of me. The other day she told me to put the garbage out. I said to her I already did. She told me to go and keep an eye on it.”

by Rodney Dangerfield