Board index   FAQ   Search  
Register  Login
Board index PHP PHP General

Having issues with adding php to Wordpress function.php?

General discussions related to php

Moderators: macek, egami, gesf

Having issues with adding php to Wordpress function.php?

Postby Acknowledged74 » Tue Feb 26, 2013 11:19 am

Hi

I have a Wordpress setup and theme running nicely. I want to add a shop and Woocommerce has been recommended as the right way to go, so I've installed that nice and easy, but it doesn't work with my theme.

I found this,

http://wcdocs.woothemes.com/codex/third ... atibility/

I am trying to implement the hook. But I'm struggling as I find the instructions unclear.

I'm sure this doesn't need any past knowledge of Woocommerce just of php.

I've added the following to line 31 of the function.php file

add_action('woocommerce_before_main_content', 'my_theme_wrapper_start', 10);
add_action('woocommerce_after_main_content', 'my_theme_wrapper_end', 10);

function my_theme_wrapper_start() {
echo '<section id="maincontent">';
}

function my_theme_wrapper_end() {
echo '</section>';
}

which to be honest is just area of the function.php with a gap. I've copied the function.php content into a Word doc linked to below.

http://www.smarterbarcodes.co.uk/phpcontent.docx

Any help on this would be great, Woo won't help until you have bought additional extensions, but if I can't get it to work, why should I?
Acknowledged74
New php-forum User
New php-forum User
 
Posts: 5
Joined: Mon Oct 01, 2012 1:55 pm

Re: Having issues with adding php to Wordpress function.php?

Postby seandisanti » Tue Feb 26, 2013 12:24 pm

You may have better luck on a wordpress forum; even though it's php, wordpress is a whole different animal, and working with wordpress hooks and events etc can be version dependent.
seandisanti
php-forum Fan User
php-forum Fan User
 
Posts: 783
Joined: Mon Oct 01, 2012 12:32 pm

Re: Having issues with adding php to Wordpress function.php?

Postby Acknowledged74 » Tue Feb 26, 2013 12:46 pm

I never get an answer to any question of the Wordpress forum, literally a waste of time.

I appreciate the fact you have atleast replied, maybe a step in the right direction.

Getting pretty frustrated.

The instruction are correct as I have used the woocommerce_content() option its just doesn't quite do what I want it to do.

I can provide the page.php as well if it help, then you would have everything that I have.
Acknowledged74
New php-forum User
New php-forum User
 
Posts: 5
Joined: Mon Oct 01, 2012 1:55 pm

Re: Having issues with adding php to Wordpress function.php?

Postby Acknowledged74 » Wed Feb 27, 2013 2:06 am

It would be great if someone took an interest to help with this, I appreciate seandisanti's reply, but I'm sure the link to the instructions would give you what you need.
Acknowledged74
New php-forum User
New php-forum User
 
Posts: 5
Joined: Mon Oct 01, 2012 1:55 pm

Re: Having issues with adding php to Wordpress function.php?

Postby seandisanti » Wed Feb 27, 2013 9:09 am

I know you said that the creators of the theme don't offer support until you purchase other products, but do they have a forum available? I'm not trying to send you away to lose you from this forum, but because I think the best help for this particular issue may be found on a site or forum dedicated to the theme or framework that you're using. Wordpress utilizes a fairly extensive MVC architecture that has evolved pretty radically even over just the last 2 years. It often happens that plugins are not updated along with the incremental revisions to wordpress and they just stop working. More than a couple of times I dove in to help someone with a wordpress issue only to find out that the failure is an old theme, plugin, or both; and short of installing wordpress, and the theme in question, and the plugin, testing suggestions before offering them becomes impossible, so you end up with wild guesses. The issue you're having is not a php issue, it is a wordpress issue, a wordpress theme issue, or a wordpress plugin issue.
seandisanti
php-forum Fan User
php-forum Fan User
 
Posts: 783
Joined: Mon Oct 01, 2012 12:32 pm


Return to PHP General

Who is online

Users browsing this forum: No registered users and 3 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.