Пример #1
0
function wf_theme_export_options()
{
    $data = wf_theme_get_option();
    $data = serialize($data);
    $data = base64_encode(gzdeflate($data, 9));
    return $data;
}
Пример #2
0
        ?>
          <div class="span7">
            <div id="teaser-video">
              <?php 
        wf_theme_option('header_video');
        ?>
            </div>
          </div>
          <div class="span5">
            <div id="video-teaser-right">
              <h2><?php 
        wf_theme_option('header_title');
        ?>
</h2>
              <?php 
        echo wpautop(do_shortcode(wf_theme_get_option('header_text')));
        ?>
            </div>
          </div>
<?php 
    }
    ?>
        </div>
<?php 
}
// end front page
?>
      </div>
    </div>
  </div>
  <div class="texture"></div>
Пример #3
0
} elseif (is_tag()) {
    echo __('Posts Tagged &#8216;', WF_THEME_TEXTDOMAIN) . single_tag_title(null, false) . '&#8217;';
} elseif (is_day()) {
    echo __('Archive for ', WF_THEME_TEXTDOMAIN) . get_the_time('F jS, Y');
} elseif (is_month()) {
    echo __('Archive for ', WF_THEME_TEXTDOMAIN) . get_the_time('F, Y');
} elseif (is_search()) {
    echo __('Search results for: ', WF_THEME_TEXTDOMAIN) . '<span class="search-query">' . get_search_query() . '</span>';
} elseif (is_year()) {
    echo __('Archive for ', WF_THEME_TEXTDOMAIN) . get_the_time('Y');
} elseif (is_author()) {
    echo __('Author Archive', WF_THEME_TEXTDOMAIN);
} elseif (isset($_GET['paged']) && !empty($_GET['paged'])) {
    echo __('Blog Archives', WF_THEME_TEXTDOMAIN);
} elseif (is_404()) {
    $page_404_id = wf_theme_get_option('page_404_id');
    if (get_the_title($page_404_id)) {
        echo get_the_title($page_404_id);
    } else {
        echo __('Page not found (error 404)', WF_THEME_TEXTDOMAIN);
    }
} else {
    echo __('Archive', WF_THEME_TEXTDOMAIN);
}
?>
</h2>
<?php 
if (have_posts()) {
    $post = $posts[0];
    while (have_posts()) {
        get_template_part('loop', 'main');
Пример #4
0
<?php

/**
 * Petrichor
 * (c) Web factory Ltd, 2013
 */
?>

<?php 
if (!is_front_page() && !is_home() && wf_theme_get_option('twitter_feed')) {
    echo '<section id="twitter-feed">
  <div class="container">
    <div class="row">
      <div class="span12">';
    echo do_shortcode('[twitter]' . wf_theme_get_option('twitter_feed') . '[/twitter]');
    echo '</div>
    </div>
  </div>
</section>';
}
?>

<footer>
  <div class="elevated">
    <div class="container">
      <div class="row">
        <div class="span12">
          <p class="copytext"><?php 
wf_theme_option('footer_left');
?>
</p>
Пример #5
0
}
// only AJAX calls allowed
if (!isset($_SERVER['X-Requested-With']) && !isset($_SERVER['HTTP_X_REQUESTED_WITH'])) {
    response('err', 'ajax');
}
// invalid name?
if (!isset($_POST['newsletter-name']) || !trim($_POST['newsletter-name']) || $_POST['newsletter-name'] == 'name' || strlen($_POST['newsletter-name']) < 3) {
    response('err', 'name');
}
// invalid email address?
if (!isset($_POST['newsletter-email']) || !preg_match('/^[^@]+@[a-zA-Z0-9._-]+\\.[a-zA-Z]+$/', trim($_POST['newsletter-email']))) {
    response('err', 'email');
}
// check MailChimp list
$api = new MCAPI(wf_theme_get_option('newsletter_api_key'));
$listId = $api->lists(array('list_name' => wf_theme_get_option('newsletter_list')), 0, 1);
$listId = @$listId['data'][0]['id'];
if (!$listId) {
    response('err', 'listid');
}
$name = trim(ucfirst($_POST['newsletter-name']));
$emailAddress = trim(strtolower($_POST['newsletter-email']));
// send email to mailchimp
$retval = $api->listSubscribe($listId, $emailAddress, array('FNAME' => $name), null, true, null, null, true);
if ($api->errorCode) {
    if ($api->errorCode == '214') {
        response('err', 'duplicate');
    } else {
        response('err', $api->errorMessage);
    }
} else {
Пример #6
0
 private function getTwitterJSON()
 {
     //require $this->lib.'tmhOAuth.php';
     //require $this->lib.'tmhUtilities.php';
     $tmhOAuth = new tmhOAuth(array('host' => $_POST['request']['host'], 'consumer_key' => wf_theme_get_option('twitter_consumer_key'), 'consumer_secret' => wf_theme_get_option('twitter_consumer_secret'), 'user_token' => wf_theme_get_option('twitter_user_token'), 'user_secret' => wf_theme_get_option('twitter_user_secret'), 'curl_ssl_verifypeer' => false));
     $url = $_POST['request']['url'];
     $params = $_POST['request']['parameters'];
     $tmhOAuth->request('GET', $tmhOAuth->url($url), $params);
     return $tmhOAuth->response;
 }
Пример #7
0
function wf_theme_exclude_category($query)
{
    if ($query->is_home() && wf_theme_get_option('slider_category')) {
        $query->set('cat', '-' . wf_theme_get_option('slider_category'));
    }
    return $query;
}