Jump to content


Photo
- - - - -

How to edit header.php of Base Theme and keep future updates?

base theme header.php future updates

  • Please log in to reply
3 replies to this topic

#1 sapcmc

sapcmc

    Member

  • Members
  • 13 posts

Posted 18 October 2012 - 09:37 PM

Hi,

I am using the Base Theme and a ecommerce plugin for wordpress - thecartpress.com .

Please Login or Register to see this Hidden Content



In order to display the shopping cart at header of website their documentation states that the header.php of theme should be edited and added the following



<?php $shoppingCart = TheCartPress::getShoppingCart();
printf( '%s item(s) in your <a href="%s">bag</a> – <a href="%s">Checkout</a>', $shoppingCart->getCount(), tcp_get_the_shopping_cart_url(), tcp_get_the_checkout_url() ); ?>

So how can I edit the header.php in the Base Theme as somehow only see it under pagelines template itself located at

˜/wp-content/themes/pagelines

Please assist as I would like this to be future release compatible.

#2 James B

James B

    Advocate

  • Moderators
  • 4979 posts
  • LocationSurrey - UK
  • Country: Country Flag

Posted 19 October 2012 - 01:25 AM

Hi there,

You'll need to add this code as a hook into the functions.php inside the base theme. Please take a look at this post for an example of how to do this

Please Login or Register to see this Hidden Content



#3 sapcmc

sapcmc

    Member

  • Members
  • 13 posts

Posted 19 October 2012 - 05:59 AM

Thanks for the help. I have gonne there but so many replies in the middle that got totally lost ...

#4 Danny

Danny

    Is Awesome!

  • Moderators
  • 13021 posts
  • LocationManchester, UK
  • Country: Country Flag

Posted 19 October 2012 - 11:19 AM

Hi,

Editing the core files is not recommend and in doing so will prevent us from providing support. I recommend you do as James suggested and use a hook. If you're unsure how create this hook, I recommend you contact one of our Pros.

Please Login or Register to see this Hidden Content







Also tagged with one or more of these keywords: base theme, header.php, future updates