• I’m about to set up a Woocommerce store for a friend.
    The theme “Lovecraft” is installed. It does not support WooCommerce.
    On this link there is a guide to make themes compatible:
    https://docs.woothemes.com/document/third-party-custom-theme-compatibility/

    The “woocommerce_content()” method did not work.

    I have tried using the “hook” method by inserting the given lines of code the themes functions.php file but I am not sure which classes and ID’s to use.
    They should be stated in the themes page.php file.
    Here is the code:

    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="main">';
    }
    
    function my_theme_wrapper_end() {
      echo '</section>';
    }

    Here is the themes page.php file:

    <?php get_header(); ?>
    
    <div class="wrapper section">
    
    	<div class="section-inner">
    
    		<div class="content">
    
    			<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    
    				<div id="post-<?php the_ID(); ?>" <?php post_class('post single'); ?>>
    
    					<div class="post-inner">
    
    						<div class="post-header">
    
    						    <h2 class="post-title"><a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
    
    						    <?php if ( current_user_can('edit_post', $post->ID) ) : ?>
    
    							    <div class="post-meta">
    
    									<?php edit_post_link('Edit', '<p>', '</p>'); ?>
    
    							    </div>
    
    						    <?php endif; ?>
    
    						</div> <!-- /post-header -->
    
    						<?php if ( get_the_content() ) : ?>
    
    							<div class="post-content">
    
    								<?php the_content(); ?>
    
    							</div>
    
    						<?php endif; ?>
    
    					</div> <!-- /post-inner -->
    
    					<?php comments_template( '', true ); ?>
    
    				</div> <!-- /post -->
    
    		   	<?php endwhile; else: ?>
    
    				<p><?php _e("We couldn't find any posts that matched your query. Please try again.", "lovecraft"); ?></p>
    
    			<?php endif; ?>    
    
    		</div> <!-- /content -->
    
    		<?php get_sidebar(); ?>
    
    		<div class="clear"></div>
    
    	</div> <!-- /section-inner -->
    
    </div> <!-- /wrapper.section -->
    
    <?php get_footer(); ?>

    Can someone please tell me how to edit those hook lines so the shop will use the theme’s wrappers?

  • The topic ‘Making Lovecraft WooCommerce compatible’ is closed to new replies.