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 » Header configuration & styling »

Add snippet of PHP code to header area (custom widgets)


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 Jan 29, 2012, 09:18 AM
crashley1784
 
79 posts · May 2009
Add snippet of PHP code to header area (custom widgets)

Hi all,

Quick question: where would I add a bit of PHP code that I want to appear in my header area? I have created a custom header area with 2 widget areas, and obviously I can't use PHP code in a widget. I tried looking at the theme files, but could not determine where I should put it.

Here is the code:

PHP Code:
<div id="btn-cart" class="fr">
<a href="<?php echo $woocommerce->cart->get_cart_url(); ?>" title="<?php _e('View your shopping cart''woothemes'); ?>">
<span>
<?php
echo sprintf(_n('%d item &ndash; ''%d items &ndash; '$woocommerce->cart->cart_contents_count'woothemes'), $woocommerce->cart->cart_contents_count);
echo 
$woocommerce->cart->get_cart_total();
?>
</span>
</a>
</div>
And here is a link to my site: http://www.laurenacooper/AFAR

I would like for the cart information (code above) to be displayed between the search bar and the navigation bar in the header.

I'm using the most current version of WP and Atahualpa, and Woocommerce as my shopping cart.

Any help is greatly appreciated

Last edited by crashley1784; Jan 29, 2012 at 09:19 AM. Reason: Forgot to add something
  #2  
Old Jan 29, 2012, 11:14 AM
juggledad's Avatar
juggledad
 
21,713 posts · Mar 2009
OSX 10.8.5 WP 3.8.x Atahualpa 3.7.x Safari 6.x Firefox 25 XP
actually you can use php in a widget if you use a plugin like 'exec php'. You can not put php in the theme options anymore due to a WordPress restriction that prevents themes from doing it (why they let widget's do and not themes is a curious question)

Try using the plugin and see it that solves your issue
__________________
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

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Google Analytics Code Snippet Not Being Recognized seo coach New Versions, & Updating 4 Jan 21, 2011 04:28 PM
Where to post code snippet for Google Analytics with this theme? sjolyjuly Atahualpa 3 Wordpress theme 17 Oct 28, 2010 09:15 PM
[SOLVED] problem stacking custom widgets in header area Thomas Sidebars & Widgets 7 Jul 6, 2010 12:01 PM
[SOLVED] How to Add Code Snippet at Bottom of Posts LaneLester Center area post/pages 0 May 16, 2010 06:21 PM
Aweber Autoresponder - how to add snippet code to wordpress theme racingprofits Sidebars & Widgets 0 Aug 24, 2009 12:02 PM


All times are GMT -6. The time now is 01:39 PM.


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