Did theme update change page templates?

Home Forums Using Thematic Child Themes Build Your Own Custom Child Themes Did theme update change page templates?

This topic is: resolved

This topic contains 17 replies, has 3 voices, and was last updated by  helgatheviking 2 years, 4 months ago.

Viewing 15 posts - 1 through 15 (of 18 total)
  • Author
    Posts
  • #1047

    devadaru
    Participant

    I just noticed our calendar page looks all wrong. Default template was applied to the page (I had assigned a special, “full width” template). I restored the full-width template, but the spacing is wrong. Did the theme update change something or reassign a template? Or has somebody else been mucking around in our back end?

    http://vedantadc.org/monthly-schedule/calendar

    Thank you!
    D

     

    (It’s been 9 or 10 months since I worked all the bugs out; now I can’t remember what I did or even how I made a new page template!)

    #1049

    helgatheviking
    Moderator

    in the last couple of months thematic has sort of come back to life.  thematic 1.0 was a pretty major update and lots of things did change.   sidenote: i figured it out, but please be specific when describing problems.  “the spacing is wrong” is a little vague… always try to tell us what specifically is wrong (with the spacing)

    1. the full page template is being deprecated.  you should create your own in your child theme.

    2. please check your site http://getfirebug.com or the chrome developer tools.  pretty quickly you will see that your #content div has a left margin and is wider than your #main div.  (these are inherited from 2-c-f-fixed.css and default.css)

    #1051

    devadaru
    Participant

    Thanks, sorry about the vagueness. The container has become too wide (it was alright before the update).  Hmmm… the challenge is re-starting that part of the brain that dealt with all this. After getting the site to a useable state,  I left it alone and have forgotten how to do things. Yes, I use the chrome developer and firebug (which changed since I last saw it, must be better but can’t figure it out yet…).

    I don’t suppose it makes sense to go back to the old version of Thematic, and let it rest for now? I can’t even remember how I styled the full page template; evidently I made a second style sheet, but where did I tell WP to look at that second stylesheet for the full page template?

    Thanks for your always helpful and speedy replies.

    D

    #1058

    devadaru
    Participant

    Okay, it turns out that I didn’t use the full page template, but put in some code in the functions.php file to turn off the sidebar, as follows:

    //this is to make full width page on calendar…
    // filter thematic_sidebar() .. no display for the page ‘Calendar’, keep it for the rest
    function remove_sidebar() {
    // We test if we are on the page ‘Calendar’
    if (is_page(‘calendar’)) {
    // Yes, we are .. now we switch off the sidebar
    return FALSE;
    } else {
    // we are not .. we leave the switch on
    return TRUE;
    }
    }
    

    This no longer seems to work. Is there a way to re-write this so it works again?
    Also, any idea how I might have assigned style2.css to the calendar page only?

    Thanks, D

    #1059

    devadaru
    Participant

    That is, it turns off the sidebar, but the container is still narrow. I think it is because the style2.css file is no longer being called. I can’t remember how I did that, alas. D

    #1060

    helgatheviking
    Moderator

    maybe your styles got lost due to the way scripts and styles are being loaded:

    http://thematictheme.com/2012/06/01/improved-script-style-loading-thematic-1-0/

    if you are not interested in re-learning thematic, i can do this in few minutes for the cost of a couple of margaritas.  email me at my username at gmail.

    #1063

    faeree
    Participant

    Hi Helga,

    Sorry to interrupt this conversation… but the full page is being depreciated?  Oh noes!  That’s what I use (I don’t use a sidebar) for all of my pages.  When you say to create your own can we just copy the existing template_fullpagewidth to our child theme then and that will resolve this or ??

    I use the layout of 2 column right and just code some overwriting CSS for width issues and I also remove the sidebar in functions.  I’m using the current (1.0.2) version of Thematic and all is fine (except the title issue which was fixed per other post- hurrah! for you guys!).

    I just don’t want to be surprised one update and my pages no longer looks/functions properly.

    Thanks :)

    #1064

    helgatheviking
    Moderator

    @faeree – yes it is being deprecated… that is why the title has changed to Deprecated Full Page Template.  same with the Blog Template.

    you can just move the file straight into your child theme.  you can also remove the sidebar by filtering thematic_sidebar on all pages:

    function remove_sidebar() {
    // We test if we are on the page ‘Calendar’
    if (is_page()) {
    // Yes, we are .. now we switch off the sidebar
    return FALSE;
    } else {
    // we are not .. we leave the switch on
    return TRUE;
    }
    
    add_filter(‘thematic_sidebar’,’remove_sidebar’);
    }
    
    #1109

    faeree
    Participant

    Thanks!

    #1170

    devadaru
    Participant

    Hello,

    In addition to the above code for filtering out the sidebar, I have in the functions.php the following code (provided I am sure by someone on this site):

    // Connect the filter to thematic_sidebar()
    add_filter('thematic_sidebar', 'remove_sidebar');
    //and make separate css sheet for calendar page, page ID=157
    function my_stylesheet($content) {
    global $wp_query;
    if (is_page()) {
    $pageID = $wp_query->post->ID;
    if ($pageID == '157') {
    $content = "\t";
    $content .= "";
    $content .= "\n\n";
    }
    }
    return $content;
    }
    add_filter ('thematic_create_stylesheet', 'my_stylesheet')

    It is this which I now understand is no longer working. Any hints?

    #1171

    devadaru
    Participant

    Umm, somehow the code is not showing properly; the part about style2.css is removed by this site. Without code tags it looks like this:

    
    // Connect the filter to thematic_sidebar()
    add_filter(‘thematic_sidebar’, ‘remove_sidebar’);
    
    //and make separate css sheet for calendar page, page ID=157
    function my_stylesheet($content) {
    global $wp_query;
    if (is_page()) {
    $pageID = $wp_query->post->ID;
    if ($pageID == ‘157’) {
    $content = “\t”;
    $content .= “<link rel=\”stylesheet\” type=\”text/css\” href=\””;
    $content .= get_bloginfo(‘stylesheet_directory’) . “/style2.css”;
    $content .= “\” />”;
    $content .= “\n\n”;
    }
    }
    return $content;
    }
    add_filter (‘thematic_create_stylesheet’, ‘my_stylesheet’);
    
    
    #1172

    helgatheviking
    Moderator

    1. don’t use code tags,  wrap everything in the appropriate shortcodes : PHP, CSS, HTML and JS…. all conveniently in the WYSIWYG editor.

    2. you skipped right over the link i already provided:

    http://thematictheme.com/2012/06/01/improved-script-style-loading-thematic-1-0/

    which deals exactly with how scripts and stylesheets are loaded.  please read it.

    #1223

    devadaru
    Participant

    Thanks, Helga. Well, I did actually check out the link you provided, but it all looked so complicated, and I didn’t easily understand what I was reading. I looked again, and yes, there is something about new stylesheets. I am trying to understand and implement it, obviously to replace the code above…

    I see that to create the new stylesheet, I will use

    function childtheme_create_stylesheet() {
    
    wp_enqueue_style( ‘calendar’, get_stylesheet_directory_uri() . ‘/style2.css’ );
    }
    add_action(‘wp_enqueue_scripts’,’childtheme_create_stylesheet’);

    How would I tell WP to use that new stylesheet style2.css only on the calendar page, pageID# 157? Since the stylesheet has now been named ‘calendar’, I suppose I need to connect page157 with ‘calendar’ somehow…

    Many thanks.

    #1233

    helgatheviking
    Moderator

    use conditional tags INSIDE your function:

    
    function childtheme_create_stylesheet() {
    
    if(is_page(157)) {
    wp_enqueue_style( ‘calendar’, get_stylesheet_directory_uri() . ‘/style2.css’ );
    }
    
    }
    add_action(‘wp_enqueue_scripts’,’childtheme_create_stylesheet’);
    
    

    http://codex.wordpress.org/Conditional_Tags

     

    #1340

    devadaru
    Participant

    Thanks, Helga, this now loads the proper stylesheet.

    But the main stylesheet is loaded just after this, cancelling the special one. Page source follows. That means something is still not timed right… (if in firebug I delete the second stylesheet, the page displays as desired)

    
    <link rel=’stylesheet’ id=’calendar-css’ href=’http://vedantadc.org/wp/wp-content/themes/Vedanta_Center_Theme/style2.css?ver=3.4.1′ type=’text/css’ media=’all’ />
    <link rel=’stylesheet’ id=’thematic_style-css’ href=’http://vedantadc.org/wp/wp-content/themes/Vedanta_Center_Theme/style.css?ver=3.4.1′ type=’text/css’ media=’all’ />
    
    
Viewing 15 posts - 1 through 15 (of 18 total)

The topic ‘Did theme update change page templates?’ is closed to new replies.