• I’m helping a friend make some changes to her website. She chose twenty twelve and I don’t want to offend her by chucking that theme entirely.

    I created a custom page template and then created a new page based on the new template. However, judging from what I see in firebug, the main stylesheet (style.css) is not getting loaded.

    There is some fancy stuff in twenty twelve that I don’t understand, for example content.php.

    Any suggestions? Thank you.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Do you have a child theme set up? It’s not advisable to modify themes directly as all the changes will be lost when WP is updated.

    https://codex.www.ads-software.com/Child_Theme

    I created a custom page template

    please post teh full code of that template – use the pastebin as described in https://codex.www.ads-software.com/Forum_Welcome#Posting_Code

    make sure to have the ‘get_header()’ line in the page template.

    Thread Starter aparente001

    (@aparente001)

    Thank you for responding! Here is what is in my custom page template (this is my first time posting code, hope it works!):

    <?php
    /*
    Template name: My Test
    */
    
    /**
     * My test custom page template
     *
     *
     * @package WordPress
     * @subpackage Twenty_Twelve
     * @since Twenty Twelve 1.0
     */
    
    get_header(); ?>
    
    	<div id="primary" class="site-content">
    		<div id="content" role="main">
    
    <p>hello from custom template</p></br>
    
    			<?php while ( have_posts() ) : the_post(); ?>
    				<?php get_template_part( 'content', 'page' ); ?>
    				<?php comments_template( '', true ); ?>
    			<?php endwhile; // end of the loop. ?>
    
    		</div><!-- #content -->
    	</div><!-- #primary -->
    
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>

    the page template file looks normal.

    what makes you believe that the style.css is not loaded?

    have you tried to clear your browser cache?

    can you post a link to illustrate the problem?

    Thread Starter aparente001

    (@aparente001)

    I got it to work as follows:

    <?php
    /*
    Template name: My Test
    */
    
    /**
     * My test custom page template
     *
     *
     * @package WordPress
     * @subpackage Twenty_Twelve
     * @since Twenty Twelve 1.0
     */
    
    get_header(); ?>
    
    	<div id="primary" class="site-content">
    		<div id="content" role="main">
    		<div id="page" class="entry-content">
    
    <p>hello from custom template</p>
    
    <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.</p>
    
    </div><!-- #page -->
    			<?php while ( have_posts() ) : the_post(); ?>
    				<?php get_template_part( 'content', 'page' ); ?>
    				<?php comments_template( '', true ); ?>
    			<?php endwhile; // end of the loop. ?>
    
    		</div><!-- #content -->
    	</div><!-- #primary -->
    
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>

    The key was
    <div id="page" class="entry-content">

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘2012 custom page template not finding styles’ is closed to new replies.