• Skip to main content

Julian Thomas Screawn

B.A. ,B.ED. ,M.ED.

  • Home
  • About
  • Websites
  • Resources
  • Coding
  • Contact

How to add custom Css to only a specific WordPress page

2025/05/16

Add the code below to your functions.php file in your child theme directory. All CSS in between the style tags will appear in the footer.

function hook_css() {
//Wordpress page ID	
if(is_page(97)){ ?>
 <style>
.content {max-width: 1080px;}
</style>
<?php
} 

}
//add to the footer
add_action('wp_footer', 'hook_css',99);

Filed Under: Genesis Framework

Copyright © 2025 · Servicing Moncton, Dieppe, Riverview and beyond! · Moncton Meditation · Moncton English Tutor