本文整理汇总了PHP中arras_get_option函数的典型用法代码示例。如果您正苦于以下问题:PHP arras_get_option函数的具体用法?PHP arras_get_option怎么用?PHP arras_get_option使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了arras_get_option函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: arras_load_styles
function arras_load_styles()
{
global $arras_registered_alt_layouts, $arras_registered_alt_styles;
if (!defined('ARRAS_INHERIT_LAYOUT') || ARRAS_INHERIT_LAYOUT == true) {
if (count($arras_registered_alt_layouts) > 0) {
$layout = defined('ARRAS_FORCE_LAYOUT') ? ARRAS_FORCE_LAYOUT : arras_get_option('layout');
wp_enqueue_style('arras-layout', get_template_directory_uri() . '/css/layouts/' . $layout . '.css', false, '2011-12-12', 'all');
}
}
if (!defined('ARRAS_INHERIT_STYLES') || ARRAS_INHERIT_STYLES == true) {
$scheme = arras_get_option('style');
if (!isset($scheme)) {
$scheme = 'default';
}
$css_path = '/css/styles/' . $scheme;
if (is_rtl()) {
$css_path .= '-rtl';
}
wp_enqueue_style('arras', get_template_directory_uri() . $css_path . '.css', false, '2011-12-12', 'all');
}
// add user css
if (!ARRAS_CHILD) {
wp_enqueue_style('arras-user', get_template_directory_uri() . '/user.css', false, '2011-12-12', 'all');
} else {
if (is_rtl()) {
wp_enqueue_style('arras-child', get_stylesheet_directory_uri() . '/rtl.css', false, '2011-12-12', 'all');
} else {
wp_enqueue_style('arras-child', get_stylesheet_directory_uri() . '/style.css', false, '2011-12-12', 'all');
}
}
// load other custom styles
do_action('arras_load_styles');
}
示例2: featured_tab
function featured_tab()
{
switch ($this->query_source) {
case 'slideshow':
$q = arras_parse_query(arras_get_option('slideshow_cat'), $this->postcount, 0, arras_get_option('slideshow_posttype'), arras_get_option('slideshow_tax'));
break;
case 'featured2':
$q = arras_parse_query(arras_get_option('featured2_cat'), $this->postcount, 0, arras_get_option('featured2_posttype'), arras_get_option('featured2_tax'));
break;
default:
$q = arras_parse_query(arras_get_option('featured1_cat'), $this->postcount, 0, arras_get_option('featured1_posttype'), arras_get_option('featured1_tax'));
}
$f = new WP_Query($q);
if (!$f->have_posts()) {
echo '<span class="textCenter sub">' . __('No posts at the moment. Check back again later!', 'arras') . '</span>';
} else {
echo '<ul>';
while ($f->have_posts()) {
$f->the_post();
?>
<li class="clearfix">
<?php
if ($this->display_thumbs) {
?>
<span class="thumb"><?php
echo arras_get_thumbnail('sidebar-thumb');
?>
</span>
<?php
}
?>
<a href="<?php
the_permalink();
?>
"><?php
the_title();
?>
</a><br />
<span class="sub"><?php
the_time(__('d F Y g:i A', 'arras'));
?>
|
<?php
comments_number(__('No Comments', 'arras'), __('1 Comment', 'arras'), __('% Comments', 'arras'));
?>
</span>
</li>
<?php
}
echo '</ul>';
}
}
示例3: arras_options_upgrade
function arras_options_upgrade()
{
// If we've already done this, bail
if (arras_get_option('updated')) {
return;
}
$new_options = array();
$settings = arras_get_settings_data();
// Load our Arras 3 default settings
foreach ($settings as $key => $value) {
$new_options[$key] = $value[0];
}
// See if we have any old options,
$old_options = maybe_unserialize(get_option('arras_options'));
if ('object' == gettype($old_options)) {
// Arras 1.x stored tapestry info in a second place in the options table
$old_tapestry_default = maybe_unserialize(get_option('arras_tapestry_default'));
// Retrieve the old defaults into an array
foreach ($old_options->defaults as $key => $value) {
$new_options[$key] = $value;
}
// Now get the non-default settings (and overwrite the defaults for those that have been set)
unset($old_options->defaults);
// we're done with those
foreach ($old_options as $key => $value) {
$new_options[$key] = $value;
}
// Add the loose settings, too!
if (is_array($old_tapestry_default)) {
$new_options['nodes_per_row'] = $old_tapestry_default['nodes'];
$new_options['nodes_excerpt'] = $old_tapestry_default['excerpt'];
}
// Check for renamed settings
$new_names = array('logo' => 'site_logo', 'header_color' => 'header_background_color', 'facebook_profile' => 'facebook', 'twitter_username' => 'twitter', 'gplus_profile' => 'google', 'flickr_profile' => 'flickr', 'youtube_profile' => 'youtube');
foreach ($new_names as $old_name => $new_name) {
if (array_key_exists($old_name, $new_options) && !empty($new_options[$old_name])) {
$new_options[$new_name] = $new_options[$old_name];
}
}
}
// One last pass to clean things up
foreach ($new_options as $key => $value) {
if (!array_key_exists($key, $settings)) {
unset($new_options[$key]);
}
}
// Write the translated options back to the database as Arras 3 options
$new_options['updated'] = true;
update_option('arras-options', $new_options);
}
示例4: arras_scripts
/**
* Enqueue scripts
*/
function arras_scripts()
{
global $paged;
// Slideshow scripts - only on first page of homepage and only if slideshow is enabled
if (is_home() && !$paged && arras_get_option('enable_slideshow') !== false) {
wp_enqueue_script('jquery-cycle', get_template_directory_uri() . '/js/jquery.cycle2-min.js', array('jquery'), null, true);
wp_enqueue_script('slideshow-settings', get_template_directory_uri() . '/js/slideshowsettings.js', array('jquery-cycle'), null, true);
wp_enqueue_script('jquery-cycle-caption', get_template_directory_uri() . '/js/jquery.cycle2.caption2.min.js', array('slideshow-settings'), null, true);
wp_enqueue_script('jquery-cycle-swipe', get_template_directory_uri() . '/js/jquery.cycle2.swipe.min.js', array('slideshow-settings'), null, true);
}
// Comment reply scripts - only on single pages
if (is_singular()) {
wp_enqueue_script('comment-reply');
}
}
示例5: get_video_posts
function get_video_posts($source = 'group', $format = 'post')
{
$output = '';
$num_of_videos = 12;
switch ($source) {
case 'channel':
$vimeo_call = 'http://vimeo.com/api/v2/channel/tetaglobule/videos.json';
default:
$vimeo_call = 'http://vimeo.com/api/v2/group/tetalab/videos.json';
}
$response = wp_remote_get($vimeo_call, array('timeout' => 60));
if (!is_wp_error($response)) {
$ret = json_decode($response["body"], true);
for ($i = 0; $i < sizeof($ret) && $i < $num_of_videos; $i++) {
$item = $ret[$i];
if (array_key_exists('title', $item) && array_key_exists('url', $item) && array_key_exists('upload_date', $item) && array_key_exists('user_name', $item) && array_key_exists('description', $item) && array_key_exists('thumbnail_medium', $item)) {
switch ($format) {
case 'rss':
$output .= '<item><title>' . htmlspecialchars($item['title']) . '</title>';
$output .= '<link>' . $item['url'] . '</link>';
$output .= '<comments>' . $item['url'] . '#comment</comments>';
$output .= '<pubDate>' . convertVimeoTime($item['upload_date']) . '</pubDate>';
$output .= '<dc:creator>' . $item['user_name'] . '</dc:creator>';
$output .= '<guid isPermaLink="false">' . $item['url'] . '</guid>';
$output .= '<description><![CDATA[' . $item['description'] . ']]></description></item>';
break;
default:
$output .= '<li class="post hentry clearfix">';
$output .= '<div class="entry-thumbnails"><a class="entry-thumbnails-link" href="' . $item['url'] . '">';
$output .= '<img src="' . $item['thumbnail_medium'] . '" ';
$output .= 'alt="' . htmlspecialchars($item['title']) . '" ';
$output .= 'title="' . htmlspecialchars($item['title']) . '" width="200px" height="150px">';
$output .= '</a></div><h3 class="entry-title">';
$output .= '<a href="' . $item['url'] . '" rel="bookmark">';
$output .= htmlspecialchars($item['title']) . '</a></h3></li>';
break;
}
} else {
$output .= '<p>Une erreur a eu lieu, pouvez-vous <a href="mailto:tetalab@lists.tetalab.org">contacter le tetalab</a> pour la signaler?</p>';
}
}
if ($format == 'post') {
$output = '<ul class="hfeed posts-' . arras_get_option('featured_display') . ' clearfix">' . $output . '</ul>';
}
}
echo $output;
}
示例6: arras_add_sidebars
/**
* Register widgetized areas and update sidebar with default widgets.
* @return null
*/
function arras_add_sidebars()
{
/* Default sidebars */
register_sidebar(array('name' => 'Primary Sidebar', 'id' => 'primary', 'before_widget' => '<li id="%1$s" class="%2$s widgetcontainer group">', 'after_widget' => '</li>', 'before_title' => '<h5 class="widgettitle">', 'after_title' => '</h5>'));
register_sidebar(array('name' => 'Secondary Sidebar', 'id' => 'secondary', 'before_widget' => '<li id="%1$s" class="%2$s widgetcontainer group">', 'after_widget' => '</li>', 'before_title' => '<h5 class="widgettitle">', 'after_title' => '</h5>'));
register_sidebar(array('name' => 'Bottom Content #1', 'id' => 'below-content-1', 'before_widget' => '<li id="%1$s" class="%2$s widgetcontainer group">', 'after_widget' => '</li>', 'before_title' => '<h5 class="widgettitle">', 'after_title' => '</h5>'));
register_sidebar(array('name' => 'Bottom Content #2', 'id' => 'below-content-2', 'before_widget' => '<li id="%1$s" class="%2$s widgetcontainer group">', 'after_widget' => '</li>', 'before_title' => '<h5 class="widgettitle">', 'after_title' => '</h5>'));
register_sidebar(array('name' => 'Header Widgets', 'id' => 'header-widgets', 'description' => 'A small widget area in the header. Use for small widgets', 'before_widget' => '<li id="%1$s" class="%2$s widgetcontainer group">', 'after_widget' => '</li>', 'before_title' => '<h5 class="widgettitle">', 'after_title' => '</h5>'));
/* Footer sidebars (Up to 4 sidebars based on user preference) */
$footer_sidebars = arras_get_option('footer_columns');
if ($footer_sidebars == '') {
$footer_sidebars = 1;
}
for ($i = 1; $i < $footer_sidebars + 1; $i++) {
register_sidebar(array('name' => 'Footer Sidebar #' . $i, 'id' => 'footer-sidebar-' . $i, 'before_widget' => '<li id="%1$s" class="%2$s widgetcontainer clearfix">', 'after_widget' => '</li>', 'before_title' => '<h5 class="widgettitle">', 'after_title' => '</h5>'));
}
}
示例7: featured_tab
function featured_tab()
{
switch ($this->query_source) {
case 'slideshow':
$list = arras_get_option('slideshow_cat');
$post_type = arras_get_option('slideshow_posttype');
$taxonomy = arras_get_option('slideshow_tax');
break;
case 'featured1':
$list = arras_get_option('featured1_cat');
$post_type = arras_get_option('featured1_posttype');
$taxonomy = arras_get_option('featured1_tax');
break;
case 'featured2':
$list = arras_get_option('featured2_cat');
$post_type = arras_get_option('featured2_posttype');
$taxonomy = arras_get_option('featured2_tax');
break;
default:
$list = arras_get_option('news_cat');
$post_type = arras_get_option('news_posttype');
$taxonomy = arras_get_option('news_tax');
}
arras_widgets_post_loop('sidebar-featured', array('list' => $list, 'taxonomy' => $taxonomy, 'show_thumbs' => $this->display_thumbs, 'show_excerpt' => false, 'query' => array('posts_per_page' => $this->postcount, 'post_type' => $post_type)));
}
示例8: _e
<th scope="row"><label for="arras-footer-title"><?php
_e('Footer Title', 'arras');
?>
</label></th>
<td>
<?php
echo arras_form_input(array('name' => 'arras-footer-title', 'id' => 'arras-footer-title', 'style' => 'width:40%', 'value' => arras_get_option('footer_title')));
?>
</td>
</tr>
<tr valign="top">
<th scope="row"><label for="arras-footer-message">Footer Message</label></th>
<td>
<?php
echo arras_form_textarea('arras-footer-message', arras_get_option('footer_message'), 'style="width: 70%; height: 100px;" class="code"');
?>
<br />
<?php
_e('Usually your website\'s copyright information would go here.<br /> It would be great if you could include a link to WordPress and even greater if you could include a link to the theme website. :)', 'arras');
?>
</td>
</tr>
</table>
<?php
do_action('arras_admin_settings-general');
?>
</div><!-- #general-settings -->
示例9: arras_add_tapestry_default_thumbs
function arras_add_tapestry_default_thumbs()
{
$layout = arras_get_option('layout');
if (strpos($layout, '1c') !== false) {
$size = array(215, 120);
} else {
if (strpos($layout, '3c') !== false) {
$size = array(230, 130);
} else {
$size = array(195, 110);
}
}
arras_add_image_size('node-based-thumb', __('Tapestry: Node-Based', 'arras'), $size[0], $size[1]);
}
示例10: arras_form_dropdown
</label></th>
<td>
<?php
echo arras_form_dropdown('arras-taxonomy-featured2', arras_get_taxonomy_list(arras_get_option('featured2_posttype')), arras_get_option('featured2_tax'));
?>
</td>
</tr>
<tr valign="top">
<th scope="row"><label for="arras-taxonomy-news"><?php
_e('News Posts', 'arras');
?>
</label></th>
<td>
<?php
echo arras_form_dropdown('arras-taxonomy-news', arras_get_taxonomy_list(arras_get_option('news_posttype')), arras_get_option('news_tax'));
?>
</td>
</tr>
</table>
<?php
do_action('arras_admin_taxonomy');
?>
<p><?php
_e('<strong>Note:</strong> Custom taxonomies require the <code>query_var</code> parameter to be defined to work.', 'arras');
?>
</p>
示例11: _e
?>
<?php
if (arras_get_option('news_title') != '') {
?>
<h2 class="home-title"><?php
_e(arras_get_option('news_title'));
?>
</h2>
<?php
}
?>
<div id="archive-posts">
<?php
arras_render_posts(null, arras_get_option('default_tapestry') ? arras_get_option('default_tapestry') : 'quick');
?>
<div class="navigation clearfix">
<div class="floatleft"><?php
next_posts_link(__('Older Entries', 'arras'));
?>
</div>
<div class="floatright"><?php
previous_posts_link(__('Newer Entries', 'arras'));
?>
</div>
</div>
</div><!-- #archive-posts -->
<?php
示例12: _e
?>
</h1>
<?php
} else {
?>
<h1 class="archive-title"><?php
_e('Archives', 'arras');
?>
</h1>
<?php
}
?>
<div id="archive-posts">
<?php
arras_render_posts(null, arras_get_option('archive_display'));
?>
<?php
if (function_exists('wp_pagenavi')) {
wp_pagenavi();
} else {
?>
<div class="navigation clearfix">
<div class="floatleft"><?php
next_posts_link(__('Older Entries', 'arras'));
?>
</div>
<div class="floatright"><?php
previous_posts_link(__('Newer Entries', 'arras'));
示例13: the_content
<div class="entry-content clearfix">
<?php
the_content(__('<p>Read the rest of this entry »</p>', 'arras'));
?>
<?php
wp_link_pages(array('before' => __('<p><strong>Pages:</strong> ', 'arras'), 'after' => '</p>', 'next_or_number' => 'number'));
?>
</div>
<?php
arras_postfooter();
?>
<?php
if (arras_get_option('display_author')) {
arras_post_aboutauthor();
}
?>
</div>
<?php
arras_below_post();
?>
<a name="comments"></a>
<?php
comments_template('', true);
?>
<?php
arras_below_comments();
?>
示例14: arras_below_nav
</div><!-- #nav -->
<?php
arras_below_nav();
?>
<div id="main" class="clearfix">
<div id="container" class="clearfix">
<div id="content" class="section">
<?php
arras_above_content();
?>
<?php
if (arras_get_option('single_meta_pos') == 'bottom') {
add_filter('arras_postfooter', 'arras_postmeta');
} else {
add_filter('arras_postheader', 'arras_postmeta');
}
?>
<?php
if (have_posts()) {
while (have_posts()) {
the_post();
?>
<?php
arras_above_post();
?>
示例15: register_sidebar
'name' => 'Bottom Content #1',
'before_widget' => '<li id="%1$s" class="widgetcontainer clearfix">',
'after_widget' => '</li>',
'before_title' => '<h5 class="widgettitle">',
'after_title' => '</h5>'
) );
register_sidebar( array(
'name' => 'Bottom Content #2',
'before_widget' => '<li id="%1$s" class="widgetcontainer clearfix">',
'after_widget' => '</li>',
'before_title' => '<h5 class="widgettitle">',
'after_title' => '</h5>'
) );*/
//Tehdään vaalit-kategorialle oma sidebar...
register_sidebar(array('name' => 'Vaalit-kategorian sivupalkki', 'before_widget' => '<li id="%1$s" class="widgetcontainer clearfix">', 'after_widget' => '</li>', 'before_title' => '<h5 class="widgettitle">', 'after_title' => '</h5>'));
$footer_sidebars = arras_get_option('footer_sidebars');
if ($footer_sidebars == '') {
$footer_sidebars = 1;
}
for ($i = 1; $i < $footer_sidebars + 1; $i++) {
register_sidebar(array('name' => 'Footerin ' . $i . '. alapalkki', 'before_widget' => '<li id="%1$s" class="widgetcontainer clearfix">', 'after_widget' => '</li>', 'before_title' => '<h5 class="widgettitle">', 'after_title' => '</h5>'));
}
// Header Actions
if (!defined('ARRAS_INHERIT_STYLES') || ARRAS_INHERIT_STYLES == true) {
add_action('arras_head', 'arras_add_style_css');
add_action('arras_custom_styles', 'arras_layout_styles');
}
if (!defined('ARRAS_INHERIT_LAYOUT') || ARRAS_INHERIT_LAYOUT == true) {
add_action('arras_head', 'arras_add_layout_css');
// Alternate Styles & Layouts
register_alternate_layout('1c-fixed', __('1 Column Layout (No Sidebars)', 'arras'));