Upgrade to Pro — share decks privately, control downloads, hide ads and more …

WordPress Customisation for Dummies (Like Me)

Job
September 08, 2016

WordPress Customisation for Dummies (Like Me)

A lot of beginners encounter all sort of tutorials on how to add some custom code to the functions.php file or even more basic: change the layout beyond what the customizer allows.

In this workshop, I introduce WordPress beginners to some good standards in terms of customisation.

Choosing a plugin that allows custom CSS (like Jetpack and Simple Custom CSS) // Setting up a child theme // Adding custom CSS to that child theme or through the plugin // Adding custom PHP to the child theme

Job

September 08, 2016
Tweet

More Decks by Job

Other Decks in Programming

Transcript

  1. Why customise? • Chat to your neighbours (3-4 people) -

    What is customisation? - When would you use it? • Share in group
  2. Is it wise
 to customise? • In groups of 3-4

    - What are the dangers of customisation? - What can you do to prevent it? • Share in group
  3. Is it wise
 to customise? • Theme/plugin updates - Overrides

    the customisation - Breaks the website • Security • Bad code
  4. Avoid problems • Plugins - Open your test site -

    Activate Simple Custom CSS • Child themes - Activate Child Theme Configurator - (configuration later)
  5. CSS selector: element .class #id property: color width value: red

    #4edf23 400px .entry-content h1 { color: red; }
  6. Custom CSS (plugin) • In groups of 3-4, - Customise

    the blockquote element - Different colour - Different background colour - Add as much customisation as you want • Use w3schools.com/css/
  7. Custom CSS .entry-content blockquote { padding: 2em; margin: 0; border-left:

    5px solid #e26a1a; background: #f6893b; font-family: Montserrat, "Helvetica Neue", sans-serif; font-weight: normal; font-size: 1em; font-style: normal; color: white; }
  8. Custom CSS .entry-content blockquote { padding: 2em; margin: 0; border-left:

    5px solid #e26a1a; background: #f6893b; font-family: Montserrat, "Helvetica Neue", sans-serif; font-weight: normal; font-size: 1em; font-style: normal; color: white; } .entry-content blockquote:not(.alignleft):not(.alignright) { margin: 0; }
  9. Child themes • Activate - Go to: Tools > Child

    Themes > Create - Activate: Appearance > Themes • Manual process
 codex.wordpress.org/Child_Themes
  10. Custom PHP • Add text to the footer • Use

    codex.wordpress.org/Plugin_API/ Action_Reference/ • Try individually or groups of 2
  11. Custom PHP function custom_footer_text() { echo '<p style="color: white; text-align:

    center;">WCCT2016 is pretty kiff</p>'; } add_action( 'wp_footer', 'custom_footer_text' );
  12. Custom PHP function custom_credit_text() { echo '<p>I'm at WordCamp Cape

    Town 2016 today!</p>'; } add_action( 'twentysixteen_credits', 'custom_credit_text' );