Esempio n. 1
0
 /**
  * Get the active instance of AppOption
  */
 public static function getInstance()
 {
     if (!isset(self::$_instance)) {
         $class = __CLASS__;
         $helper = new $class();
         self::$_instance = $helper->getOneBy(self::KEY_IS_ACTIVE, true);
         // If the default app-option post is deleted from WordPress
         // then just create an instance on the fly which will use the default values in getFields
         if (!is_object(self::$_instance)) {
             self::$_instance = new $class();
         }
     }
     return self::$_instance;
 }
Esempio n. 2
0
<!doctype html>
<?php 
$theme = AppOption::getInstance();
?>
<html class="no-js" <?php 
language_attributes();
?>
>
<head>
  <meta charset="<?php 
bloginfo('charset');
?>
">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <title><?php 
echo app_get_page_title();
?>
</title>

  <?php 
include __DIR__ . '/incl-open-graph-meta.php';
?>

  <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1">

  <link href='http://fonts.googleapis.com/css?family=Open+Sans:400,600,700,800' rel='stylesheet' type='text/css'>

  <?php 
echo get_app_icons();
?>
Esempio n. 3
0
/**
 * Get App Options link when admin is logged in
 * @param string $description
 * @param bool $display_inline
 * @return type
 */
function get_app_options_link($description = null, $display_inline = false)
{
    if (!(is_user_logged_in() && current_user_can('manage_options'))) {
        return null;
    }
    if (is_null($description)) {
        $description = 'this';
    }
    $options = AppOption::getInstance();
    return get_edit_link($options->ID, 'app-option', $description . ' in ' . $options->getPlural(), $display_inline);
}
<?php

$analytics_tag_manager_key = AppOption::getInstance()->get('analytics_tag_manager_key');
if ($analytics_tag_manager_key) {
    ?>
  <!-- Google Tag Manager -->
  <noscript><iframe src="//www.googletagmanager.com/ns.html?id=<?php 
    echo $analytics_tag_manager_key;
    ?>
" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
  <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
  new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
  j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
  '//www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
  })(window,document,'script','dataLayer','<?php 
    echo $analytics_tag_manager_key;
    ?>
');</script>
  <!-- End Google Tag Manager -->
<?php 
}
<?php

/* Template Name: Contact */
get_header();
$app_option = AppOption::getInstance();
?>

<div class="contact-info" itemscope itemtype="http://schema.org/Organization">
  <span itemprop="name">Client Name</span>
  <div itemprop="address" itemscope itemtype="http://schema.org/PostalAddress">
    <span itemprop="streetAddress">
      <?php 
echo $app_option->get('contact_street');
?>
    </span>
    <span itemprop="addressLocality">
      <?php 
echo $app_option->get('contact_city');
?>
    </span>,
    <span itemprop="addressRegion">
      <?php 
echo $app_option->get('contact_state');
?>
    </span>
    <span itemprop="postalCode">
      <?php 
echo $app_option->get('contact_zip');
?>
    </span>
  </div>