-1

I have a wordpress site, and I need to apply custom styles to one page, I see the custom styles option, and some of them work, but others get overwritten. Is there a way I can apply strictly my own styles to a portion of the page?

Thanks,

Brian

3
  • 3
    Your question is unclear - what is the 'custom styles' option? What theme/plugin are you using? Could this be more of a CSS question then a WordPress question?
    – shea
    Commented Dec 9, 2012 at 21:23
  • @shea a lot of themes include a custom styles panel within the Appearance menu, it's a pretty common thing I've seen in WordPress.
    – Will Lanni
    Commented Mar 19, 2015 at 0:32
  • @WillLanni It is, however, specific to the plugin or theme and the implementation will vary.
    – shea
    Commented Mar 19, 2015 at 2:15

1 Answer 1

2
  1. Open your theme functions.php.
    1. FTP/Server access: Navigate to your WP install and look in /wp-content/themes/[your theme folder]
    2. Via the WP Dashboard: Appearance > Editor, then look for Theme Functions (functions.php) in the right column
  2. Add the following to add a custom style sheet (replace "custom-style.css" with a better style sheet name, and replace 'your-page-slug' with the slug of the page you wish to add the custom style to):

    // script manager template for registering and enqueuing files
    function childtheme_script_manager() {
        // register custom style on your specific page
        if (is_page('your-page-slug')) {
            wp_register_style('custom-css', get_stylesheet_directory_uri() . '/custom-style.css');
            wp_enqueue_style ('custom-css');
        }
    }
    add_action('wp_enqueue_scripts', 'childtheme_script_manager');
    
  3. Create a style sheet in your theme folder called custom-style.css. Add your custom styles. Write the css to target whatever it is on your page that needs specific styling. Without anymore information or posting example code on that page, it's impossible to answer that.

5
  • Where is my theme folder, I have search endlessly for a "file upload" feature, but haven't found one. I'm a real CLI junky and I'm having a tough time with this bloated Graphical Interface. Commented Dec 10, 2012 at 23:15
  • Added the info into step one. :)
    – Will Lanni
    Commented Dec 11, 2012 at 1:07
  • I see now I actually have to go in to my hosting client to modify the backend. That was very unclear. Commented Dec 11, 2012 at 3:26
  • Gotcha—my bad! Did the added info in step one clear that up?
    – Will Lanni
    Commented Dec 11, 2012 at 6:34
  • Yes. Thanks for your answer. I think I've got the general idea now. Thanks a ton! Commented Dec 11, 2012 at 23:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.