Developer Guide

Common Code in Functions File

This common code should be the first items in a themes functions file (master theme or custom theme, child themes do not need this code)

  1. All themes function files should have a line adding theme support for dc-theme; this will enable them customization features such as themes, fonts, logos, etc.
    add_theme_support( ‘dc-theme’ );
  2. Any global variables needs for theme functionality should be included before the next line.  This includes the variables:
    • $GLOBALS[‘fonts’] – an array that contains font options and font label -> css value pairs
    • $GLOBALS[‘palettes’] – an array that contains color palettes and in the individual colors of each palette
  3. All theme functions file have a call to the global functions file in /themes/dc-global/
    include (get_theme_root() . ‘/dc-global/dc-functions.php’);
  4. Set content width of main content; this is useful mainly for determining the base size for images uploaded to interior pages.
    $content_width = 600;

Using do_action to insert functionality

Use do_action wp function in order to insert in template, example: do_action(‘insert_social’);

  • do_action(‘insert_copyright’): inserts HTML with copyright info, wp login, and dc logo
  • do_action(‘insert_mpform’): functionality for including mp form iframe into main content
  • do_action(‘insert_social’, bool): ul.social list that checks for social link fields and displays accordingly; boolean indicates whether to open in same or new window

Prepping MP member site to work with WP site

Here is a running list of things to do (work in progress):

  • Make sure member site has been configured for VMS
  • Update article-01 to redirect to article-vms-iframe
  • Update navdata for the pages ?nd=login and ?nd=resetpassword; this may require updating navdata.txt
  • On the wordpress site, ensure that the faux WP theme “dc-global” is loaded and included using the themes functions.php file