• Resolved maxpayne13

    (@maxpayne13)


    Hey everyone, please I am in desperate need of some help. So I would like to remove the padding inside the entry-content but only for one page.

    I am using google chrome and this is the exact line of code I need to change

    entry-content{overflow:visible;padding:0 20px;border-top:3px double #e5e5e5}

    all I want to do is change the 20px to zero for 1 page only.

    I added this to CSS file but no luck

    .page-id-991.entry-content{overflow:visible;padding:0 0px;border-top:3px double #e5e5e5}

    Please can anyone help?

Viewing 6 replies - 31 through 36 (of 36 total)
  • Thread Starter maxpayne13

    (@maxpayne13)

    COOL!!!!

    okay I will definetly try this tonight, that was great. Thanks friend.

    Just a footnote to this, which could help other people searching the topics, we can create a Page Template as described above, then in the page code look for the Post Class.

    Lets say we wanted a page template for ‘Our Staff’, or a page to dispaly a custom content loop, in a custom layout, we open page.php and save this as template-staff.php

    Open the template-staff.php file and add our template code:

    <?php
    /*
    Template Name: Our Staff
    */

    Now we find the Body Class, in twenty eleven it would be this line

    <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>

    We can add a custom class to this page template.

    <article id="post-<?php the_ID(); ?>" <?php post_class('our-staff'); ?>>

    Now our-staff will be added as a class for our page template!

    In style.css we can add our styles, something like.

    .our-staff {
       background: #e0e0e0;
       border solid 1px #ccc;
    }

    Apply the Template to our page, add the content and publish.

    If we can code a little and we are using custom post types or a category for our staff, for the content or loop, in twenty eleven we would create a file content-staff.php with the custom loop, then in the page template find.

    <?php get_template_part( 'content', 'page' ); ?>

    Change this to:

    <?php get_template_part( 'content', 'staff' ); ?>

    That’s it!

    HTH

    David

    Thread Starter maxpayne13

    (@maxpayne13)

    Very useful stuff…….I am havign a few issues with building a child theme which I suppose I should take care of that first, also a little issue with a plugin. maybe you can help while I have your attention I

    What happens is I create a style.CSS by copying the original style.CSS from my theme (news) and place it in a folder that I name “mysitename” (just an example). then I erase all the contents from the CSS I just copied and add the description lines as such
    /*
    Theme Name: mysitename
    Theme URI: https://mysitename.com/
    Description: Theme for Mysitename
    Author: Max Payne
    Author URI: n/a
    Template: News
    Version: 1.0
    */

    I hit save and then apply the new theme to my site. But all of the formats are missing? Do I need to do something else? I tried adding some formatting on the new CSS but its still only grabbing formats from the orginal CSS.

    my other painful little issue is the plugin Audio Tube
    found here https://www.ads-software.com/extend/plugins/audio-tube/
    all of a sudden stoped working a few nights ago. It was literally working fine one minute the next minute it stopped? The issue is that it doesn’t work on any desktop browser now, the player that is supposed to be there is gone and instead some weird window appears. On mobile phone browsers it works fine? i will investigate this tonight.

    heres the site so you can see what I mean.
    https://216.172.171.18/~carranza/test4/?page_id=991

    If you can help that would be great.

    1 other things,

    Thread Starter maxpayne13

    (@maxpayne13)

    hey friend, so i tried what you said and it works like a charm I modified the template without padding for my tables :)), I didnt try the second part though, I dont understand what will happen once you complete the final step?

    <?php get_template_part( ‘content’, ‘page’ ); ?>
    Change this to:
    <?php get_template_part( ‘content’, ‘staff’ ); ?>

    so it will apply the code from the content-staff.php to the template-staff.php correct? but why is that important? Also can you try and answer the 2 questions above, please and that was great.

    I erase all the contents from the CSS I just copied and add the description lines as such

    You need the @import line to get the parents styles:

    * =Do not add styles before the Stylesheet import
    -------------------------------------------------------------- */
    @import url('../twentyeleven/style.css');
    
    /* =Add our custom style changes below this line
    -------------------------------------------------------------- */

    so it will apply the code from the content-staff.php to the template-staff.php correct? but why is that important?.

    That part is only required or important where you need to change the layout or code in the content (loop), your solution did not need it, so it was there for others reading this topic.

    post_class()
    Yours was one of two topics I answered, the other changed the post_class() in the loop based on a $counter, so I am writing an article over the weekend using post_class() and code to create four layouts:
    1. page: the example above page post_class()
    2. content: a magazine layout two posts above three repeating
    3. content: a thumbnail switch where the thumbnail is floated left(odd) right(even)
    4. content: with seven colored post backgrounds repeating

    I will post a link back here when done so you can have a look at what else can be done with post_class

    HTH

    David

    Thread Starter maxpayne13

    (@maxpayne13)

    So I tried what you said and Yeah it works to a degree, you see I noticed there were some pages that didn’t display properly unless I brought over the images folder. I also had added some pages so I brought them as well but the slider on the home page is not working properly. I had modified the JS script file to speed up transitions between slides and even by bringing over the file the speed remains the slow. The only way is to constantly go back after an update to the theme and replace the JS file in the original theme folder? So I just brough over all folders and files except funtions which cause it to crash. Not sure but do you think I will have issues if I keep this set up? How important is it to have a child theme set up?

Viewing 6 replies - 31 through 36 (of 36 total)
  • The topic ‘Change CSS for Single Page’ is closed to new replies.