本文整理汇总了PHP中theme_locals函数的典型用法代码示例。如果您正苦于以下问题:PHP theme_locals函数的具体用法?PHP theme_locals怎么用?PHP theme_locals使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了theme_locals函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: cherry_prepare_download_backup_callback
function cherry_prepare_download_backup_callback()
{
check_ajax_referer('cherry_download_backup', 'wp_nonce_download_backup');
if (!current_user_can('export')) {
wp_die('You do not have permissions to do this', 'Error');
}
$file = isset($_GET['file']) ? $_GET['file'] : '';
if (!$file) {
wp_die('File not provided', 'Error');
}
if (file_exists($file)) {
header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename=' . basename($file));
header('Content-Transfer-Encoding: binary');
header('Expires: 0');
header('Cache-Control: must-revalidate');
header('Pragma: public');
header('Content-Length: ' . filesize($file));
readfile($file);
} else {
echo theme_locals("unfortunately") . $theme_folder . theme_locals("please_try");
}
exit;
}
开发者ID:robbuh,项目名称:CherryFramework,代码行数:25,代码来源:download_backup.php
示例2: myHelpPointers
function myHelpPointers()
{
//First we define our pointers
$pointers = array(array('id' => 'xyz1', 'screen' => 'options-permalink', 'target' => '#submit', 'title' => theme_locals("submit_permalink"), 'content' => theme_locals("submit_permalink_desc"), 'position' => array('edge' => 'top', 'align' => 'left', 'offset' => '0 5')), array('id' => 'xyz2', 'screen' => 'themes', 'target' => '#toplevel_page_options-framework', 'title' => theme_locals("import_sample_data"), 'content' => theme_locals("import_sample_data_desc"), 'position' => array('edge' => 'bottom', 'align' => 'top', 'offset' => '0 -10')), array('id' => 'xyz3', 'screen' => 'toplevel_page_options-framework', 'target' => '#toplevel_page_options-framework', 'title' => theme_locals("import_sample_data"), 'content' => theme_locals("import_sample_data_desc_2"), 'position' => array('edge' => 'left', 'align' => 'top', 'offset' => '0 18')));
//Now we instantiate the class and pass our pointer array to the constructor
$myPointers = new WP_Help_Pointer($pointers);
}
开发者ID:rafaelfranco,项目名称:gruporota_portal,代码行数:7,代码来源:custom-function.php
示例3: elegance_widgets_init
function elegance_widgets_init() {
// Sidebar Widget
// Location: the sidebar
register_sidebar(array(
'name' => theme_locals("sidebar"),
'id' => 'main-sidebar',
'description' => theme_locals("sidebar_desc"),
'before_widget' => '<div id="%1$s" class="widget">',
'after_widget' => '</div>',
'before_title' => '<h3>',
'after_title' => '</h3>',
));
// Footer Widget Area 1
// Location: at the top of the footer, above the copyright
register_sidebar(array(
'name' => theme_locals("footer_1"),
'id' => 'footer-sidebar-1',
'description' => theme_locals("footer_desc"),
'before_widget' => '<div id="%1$s">',
'after_widget' => '</div>',
'before_title' => '<h4>',
'after_title' => '</h4>',
));
// Footer Widget Area 2
// Location: at the top of the footer, above the copyright
register_sidebar(array(
'name' => theme_locals("footer_2"),
'id' => 'footer-sidebar-2',
'description' => theme_locals("footer_desc"),
'before_widget' => '<div id="%1$s">',
'after_widget' => '</div>',
'before_title' => '<h4>',
'after_title' => '</h4>',
));
// Footer Widget Area 3
// Location: at the top of the footer, above the copyright
register_sidebar(array(
'name' => theme_locals("footer_3"),
'id' => 'footer-sidebar-3',
'description' => theme_locals("footer_desc"),
'before_widget' => '<div id="%1$s">',
'after_widget' => '</div>',
'before_title' => '<h4>',
'after_title' => '</h4>',
));
// Footer Widget Area 4
// Location: at the top of the footer, above the copyright
register_sidebar(array(
'name' => theme_locals("footer_4"),
'id' => 'footer-sidebar-4',
'description' => theme_locals("footer_desc"),
'before_widget' => '<div id="%1$s">',
'after_widget' => '</div>',
'before_title' => '<h4>',
'after_title' => '</h4>',
));
}
开发者ID:kevinreilly,项目名称:mendelements.com,代码行数:58,代码来源:sidebar-init.php
示例4: cherry_widgets_init
function cherry_widgets_init()
{
// Sidebar Widget
// Location: the sidebar
register_sidebar(array('name' => theme_locals("sidebar"), 'id' => 'main-sidebar', 'description' => theme_locals("sidebar_desc"), 'before_widget' => '<div id="%1$s" class="widget">', 'after_widget' => '</div>', 'before_title' => '<h3>', 'after_title' => '</h3>'));
// Footer Widget Area
// Location: at the top of the footer, above the copyright
register_sidebar(array('name' => __('Footer Area', CURRENT_THEME), 'id' => 'footer-sidebar', 'description' => theme_locals("footer_desc"), 'before_widget' => '<div id="%1$s">', 'after_widget' => '</div>', 'before_title' => '<h4 class="widget-title">', 'after_title' => '</h4>'));
}
开发者ID:drupalninja,项目名称:schome_org,代码行数:9,代码来源:sidebar-init.php
示例5: theme_folder_single_site
public function theme_folder_single_site( $actions, $theme ){
$theme_template = $theme->template;
if(strtolower($theme_template) == "cherryframework"){
$backup_theme = $theme->stylesheet;
$backup_button = '<a href="../wp-content/themes/'.$theme_template.'/includes/data_management/backup.php?theme_folder=/'.$backup_theme.'" title="'.theme_locals("backup").'" class="backup_theme">'.theme_locals("backup").'</a>';
array_push($actions, $backup_button);
}
return $actions;
}
开发者ID:kevinreilly,项目名称:mendelements.com,代码行数:9,代码来源:data_management_interface.php
示例6: button_shortcode
function button_shortcode($atts, $content = null)
{
extract(shortcode_atts(array('link' => 'http://www.google.com', 'text' => theme_locals("read_more"), 'size' => 'normal', 'style' => '', 'target' => '_self', 'display' => '', 'class' => '', 'icon' => 'no'), $atts));
$output = '<a href="' . $link . '" title="' . $text . '" class="btn btn-' . $style . ' btn-' . $size . ' btn-' . $display . ' ' . $class . '" target="' . $target . '">';
if ($icon != 'no') {
$output .= '<i class="icon-' . $icon . '"></i>';
}
$output .= $text;
$output .= '</a><!-- .btn -->';
return $output;
}
开发者ID:poolieweb,项目名称:LawStaticAthena,代码行数:11,代码来源:html.php
示例7: cherry_widgets_init
function cherry_widgets_init()
{
// Custom widget area.
register_sidebar(array('name' => __('Custom Widget Area'), 'id' => 'custom-widget-area', 'description' => __('An optional custom widget area for your site', 'twentyten'), 'before_widget' => '<li id="%1$s" class="widget-container %2$s">', 'after_widget' => "</li>", 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>'));
// Sidebar Widget
// Location: the sidebar
register_sidebar(array('name' => theme_locals("sidebar"), 'id' => 'main-sidebar', 'description' => theme_locals("sidebar_desc"), 'before_widget' => '<div id="%1$s" class="widget">', 'after_widget' => '</div>', 'before_title' => '<h3>', 'after_title' => '</h3>'));
// Footer Widget Area 1
// Location: at the top of the footer, above the copyright
register_sidebar(array('name' => theme_locals("footer_1"), 'id' => 'footer-sidebar-1', 'description' => theme_locals("footer_desc"), 'before_widget' => '<div id="%1$s">', 'after_widget' => '</div>', 'before_title' => '<h3>', 'after_title' => '</h3>'));
// Footer Widget Area 2
// Location: at the top of the footer, above the copyright
register_sidebar(array('name' => theme_locals("footer_2"), 'id' => 'footer-sidebar-2', 'description' => theme_locals("footer_desc"), 'before_widget' => '<div id="%1$s">', 'after_widget' => '</div>', 'before_title' => '<h3>', 'after_title' => '</h3>'));
}
开发者ID:hoangluanlee,项目名称:dlbh,代码行数:14,代码来源:sidebar-init.php
示例8: cherry_restore_callback
function cherry_restore_callback()
{
$theme_folder = isset($_GET['theme_folder']) ? $_GET['theme_folder'] : '';
if (!$theme_folder) {
wp_die('File not provided', 'Error');
}
$file = str_replace('\\', '/', WP_CONTENT_DIR) . '/themes_backup/' . $theme_folder . ".zip";
$themes_folder = str_replace('\\', '/', get_theme_root()) . '/' . $theme_folder;
if (file_exists($file)) {
chery_remove_dir($themes_folder);
cherry_unzip_backup($file, $themes_folder);
} else {
echo theme_locals("unfortunately") . $theme_folder . theme_locals("please_try");
}
}
开发者ID:robbuh,项目名称:CherryFramework,代码行数:15,代码来源:restore.php
示例9: form
/** @see WP_Widget::form */
function form($instance) {
/* Set up some default widget settings. */
$defaults = array( 'title' => '', 'flickr_id' => '', 'image_amount' => '', 'linktext' => '' );
$instance = wp_parse_args( (array) $instance, $defaults );
$title = esc_attr($instance['title']);
$flickr_id = esc_attr($instance['flickr_id']);
$amount = esc_attr($instance['image_amount']);
$linktext = esc_attr($instance['linktext']);
?>
<p><label for="<?php echo $this->get_field_id('title'); ?>"><?php echo theme_locals("title"); ?> <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo $title; ?>" /></label></p>
<p><label for="<?php echo $this->get_field_id('flickr_id'); ?>"><?php echo theme_locals("flickr_id"); ?> <input class="widefat" id="<?php echo $this->get_field_id('flickr_id'); ?>" name="<?php echo $this->get_field_name('flickr_id'); ?>" type="text" value="<?php echo $flickr_id; ?>" /></label></p>
<p><label for="<?php echo $this->get_field_id('image_amount'); ?>"><?php echo theme_locals("images_count"); ?> <input class="widefat" id="<?php echo $this->get_field_id('image_amount'); ?>" name="<?php echo $this->get_field_name('image_amount'); ?>" type="text" value="<?php echo $amount; ?>" /></label></p>
<p><label for="<?php echo $this->get_field_id('linktext'); ?>"><?php echo theme_locals("link_text"); ?> <input class="widefat" id="<?php echo $this->get_field_id('linktext'); ?>" name="<?php echo $this->get_field_name('linktext'); ?>" type="text" value="<?php echo $linktext; ?>" /></label></p>
<?php }
开发者ID:kevinreilly,项目名称:mendelements.com,代码行数:17,代码来源:my-flickr-widget.php
示例10: widget
function widget( $args, $instance ) {
global $wpdb, $comments, $comment;
extract($args, EXTR_SKIP);
$title = apply_filters('widget_title', empty($instance['title']) ? theme_locals("recent_comments_decs") : $instance['title']);
if ( !$number = (int) $instance['number'] )
$number = 5;
else if ( $number < 1 )
$number = 1;
else if ( $number > 15 )
$number = 15;
$comment_len = 100;
if ( !$comments = wp_cache_get( 'recent_comments', 'widget' ) ) {
$comments = $wpdb->get_results("SELECT * FROM $wpdb->comments WHERE comment_approved = '1' and comment_type not in ('pingback','trackback') ORDER BY comment_date_gmt DESC LIMIT 15");
wp_cache_add( 'recent_comments', $comments, 'widget' );
}
$comments = array_slice( (array) $comments, 0, $number );
?>
<?php echo $before_widget; ?>
<?php if ( $title ) echo $before_title . $title . $after_title; ?>
<ul class="comments-custom unstyled"><?php
if ( $comments ) : foreach ( (array) $comments as $comment) :?>
<li class="comments-custom_li">
<?php if(function_exists('get_avatar')) {
echo '<figure class="thumbnail featured-thumbnail">';
echo get_avatar( get_the_author_meta('email'), '58' ); /* This avatar is the user's gravatar (http://gravatar.com) based on their administrative email address */
echo '</figure>';
} ?>
<h4 class="comments-custom_h"><?php echo $comment->comment_author; ?></h4>
<time><?php echo $comment->comment_date; ?></time>
<div class="clear"></div>
<div class="comments-custom_txt">
<a href="<?php echo get_comment_link( $comment->comment_ID ); ?>" title="<?php echo theme_locals("go_to_c"); ?>"><?php echo strip_tags(substr(apply_filters('get_comment_text', $comment->comment_content), 0, $comment_len)); if (strlen($comment->comment_content) > $comment_len) echo '...';?></a>
</div>
</li>
<?php
endforeach; endif;?>
</ul>
<?php echo $after_widget; ?>
<?php
}
开发者ID:kevinreilly,项目名称:mendelements.com,代码行数:47,代码来源:my-comment-widget.php
示例11: myHelpPointers
function myHelpPointers() {
//First we define our pointers
$pointers = array(
array(
'id' => 'xyz1', // unique id for this pointer
'screen' => 'options-permalink', // this is the page hook we want our pointer to show on
'target' => '#submit', // the css selector for the pointer to be tied to, best to use ID's
'title' => theme_locals("submit_permalink"),
'content' => theme_locals("submit_permalink_desc"),
'position' => array(
'edge' => 'top', //top, bottom, left, right
'align' => 'left', //top, bottom, left, right, middle
'offset' => '0 5'
)
),
array(
'id' => 'xyz2', // unique id for this pointer
'screen' => 'themes', // this is the page hook we want our pointer to show on
'target' => '#toplevel_page_options-framework', // the css selector for the pointer to be tied to, best to use ID's
'title' => theme_locals("import_sample_data"),
'content' => theme_locals("import_sample_data_desc"),
'position' => array(
'edge' => 'bottom', //top, bottom, left, right
'align' => 'top', //top, bottom, left, right, middle
'offset' => '0 -10'
)
),
array(
'id' => 'xyz3', // unique id for this pointer
'screen' => 'toplevel_page_options-framework', // this is the page hook we want our pointer to show on
'target' => '#toplevel_page_options-framework', // the css selector for the pointer to be tied to, best to use ID's
'title' => theme_locals("import_sample_data"),
'content' => theme_locals("import_sample_data_desc_2"),
'position' => array(
'edge' => 'left', //top, bottom, left, right
'align' => 'top', //top, bottom, left, right, middle
'offset' => '0 18'
)
)
// more as needed
);
//Now we instantiate the class and pass our pointer array to the constructor
$myPointers = new WP_Help_Pointer($pointers);
};
开发者ID:kevinreilly,项目名称:mendelements.com,代码行数:46,代码来源:custom-function.php
示例12: my_theme_register_required_plugins
/**
* Register the required plugins for this theme.
*
* In this example, we register two plugins - one included with the TGMPA library
* and one from the .org repo.
*
* The variable passed to tgmpa_register_plugins() should be an array of plugin
* arrays.
*
* This function is hooked into tgmpa_init, which is fired within the
* TGM_Plugin_Activation class constructor.
*/
function my_theme_register_required_plugins()
{
/**
* Array of plugin arrays. Required keys are name and slug.
* If the source is NOT from the .org repo, then source is also required.
*/
$plugins = array(array('name' => 'Contact Form 7', 'slug' => 'contact-form-7', 'source' => CHILD_DIR . '/includes/plugins/contact-form-7.zip', 'required' => true, 'version' => '', 'force_activation' => true, 'force_deactivation' => false, 'external_url' => ''), array('name' => 'Cherry Plugin', 'slug' => 'cherry-plugin', 'source' => PARENT_DIR . '/includes/plugins/cherry-plugin.zip', 'required' => true, 'version' => '0.1', 'force_activation' => true, 'force_deactivation' => false, 'external_url' => ''));
/**
* Array of configuration settings. Amend each line as needed.
* If you want the default strings to be available under your own theme domain,
* leave the strings uncommented.
* Some of the strings are added into a sprintf, so see the comments at the
* end of each line for what each argument will be.
*/
$config = array('domain' => CURRENT_THEME, 'default_path' => '', 'parent_menu_slug' => 'themes.php', 'parent_url_slug' => 'themes.php', 'menu' => 'install-required-plugins', 'has_notices' => true, 'is_automatic' => true, 'message' => '', 'strings' => array('page_title' => theme_locals("page_title"), 'menu_title' => theme_locals("menu_title"), 'installing' => theme_locals("installing"), 'oops' => theme_locals("oops_2"), 'notice_can_install_required' => _n_noop(theme_locals("notice_can_install_required"), theme_locals("notice_can_install_required_2")), 'notice_can_install_recommended' => _n_noop(theme_locals("notice_can_install_recommended"), theme_locals("notice_can_install_recommended_2")), 'notice_cannot_install' => _n_noop(theme_locals("notice_cannot_install"), theme_locals("notice_cannot_install_2")), 'notice_can_activate_required' => _n_noop(theme_locals("notice_can_activate_required"), theme_locals("notice_can_activate_required_2")), 'notice_can_activate_recommended' => _n_noop(theme_locals("notice_can_activate_recommended"), theme_locals("notice_can_activate_recommended_2")), 'notice_cannot_activate' => _n_noop(theme_locals("notice_cannot_activate"), theme_locals("notice_cannot_activate_2")), 'notice_ask_to_update' => _n_noop(theme_locals("notice_ask_to_update"), theme_locals("notice_ask_to_update_2")), 'notice_cannot_update' => _n_noop(theme_locals("notice_cannot_update"), theme_locals("notice_cannot_update_2")), 'install_link' => _n_noop(theme_locals("install_link"), theme_locals("install_link_2")), 'activate_link' => _n_noop(theme_locals("activate_link"), theme_locals("activate_link_2")), 'return' => theme_locals("return"), 'plugin_activated' => theme_locals("plugin_activated"), 'complete' => theme_locals("complete"), 'nag_type' => theme_locals("updated")));
tgmpa($plugins, $config);
}
开发者ID:rafaelfranco,项目名称:gruporota_portal,代码行数:29,代码来源:register-plugins.php
示例13: tz_show_box_category
function tz_show_box_category()
{
global $meta_box_category, $post;
// Use nonce for verification
echo '<input type="hidden" name="tz_meta_box_nonce" value="', wp_create_nonce(basename(__FILE__)), '" />';
echo '<table class="form-table">';
foreach ($meta_box_category['fields'] as $field) {
// get current post meta data
$meta = get_post_meta($post->ID, $field['id'], true);
switch ($field['type']) {
//If Text
case 'text':
echo '<tr>', '<th style="width:25%"><label for="', $field['id'], '"><strong>', theme_locals($field['name']), '</strong><span style=" display:block; color:#999; margin:5px 0 0 0; line-height: 18px;">' . theme_locals($field['desc']) . '</span></label></th>', '<td>';
echo '<input type="text" name="', $field['id'], '" id="', $field['id'], '" value="', $meta ? $meta : stripslashes(htmlspecialchars($field['std'], ENT_QUOTES)), '" size="30" style="width:75%; margin-right: 20px; float:left;" />';
break;
}
}
echo '</table>';
}
开发者ID:woniu123360,项目名称:CherryFramework,代码行数:19,代码来源:theme-pagemeta.php
示例14: my_show_box_testi
function my_show_box_testi()
{
global $meta_box_testi, $post;
echo '<p style="padding:10px 0 0 0;">' . theme_locals("testimonial_options_desc") . '</p>';
// Use nonce for verification
echo '<input type="hidden" name="my_meta_box_nonce" value="', wp_create_nonce(basename(__FILE__)), '" />';
echo '<table class="form-table">';
foreach ($meta_box_testi['fields'] as $field) {
// get current post meta data
$meta = get_post_meta($post->ID, $field['id'], true);
switch ($field['type']) {
//If Text
case 'text':
echo '<tr style="border-top:1px solid #eeeeee;">', '<th style="width:25%"><label for="', $field['id'], '"><strong>', theme_locals($field['name']), '</strong><span style=" display:block; color:#999; margin:5px 0 0 0; line-height: 18px;">' . theme_locals($field['desc']) . '</span></label></th>', '<td>';
echo '<input type="text" name="', $field['id'], '" id="', $field['id'], '" value="', $meta ? $meta : stripslashes(htmlspecialchars($field['std'], ENT_QUOTES)), '" size="30" style="width:75%; margin-right: 20px; float:left;" />';
break;
//If textarea
//If textarea
case 'textarea':
echo '<tr style="border-top:1px solid #eeeeee;">', '<th style="width:25%"><label for="', $field['id'], '"><strong>', theme_locals($field['name']), '</strong><span style="line-height:18px; display:block; color:#999; margin:5px 0 0 0;">' . theme_locals($field['desc']) . '</span></label></th>', '<td>';
echo '<textarea name="', $field['id'], '" id="', $field['id'], '" value="', $meta ? $meta : stripslashes(htmlspecialchars($field['std'], ENT_QUOTES)), '" rows="8" cols="5" style="width:100%; margin-right: 20px; float:left;">', $meta ? $meta : stripslashes(htmlspecialchars($field['std'], ENT_QUOTES)), '</textarea>';
break;
//If Select
//If Select
case 'select':
echo '<tr>', '<th style="width:25%"><label for="', $field['id'], '"><strong>', theme_locals($field['name']), '</strong><span style=" display:block; color:#999; margin:5px 0 0 0; line-height: 18px;">' . theme_locals($field['desc']) . '</span></label></th>', '<td>';
echo '<select id="' . $field['id'] . '" name="' . $field['id'] . '">';
foreach ($field['options'] as $option) {
echo '<option';
if ($meta == $option) {
echo ' selected="selected"';
}
echo '>' . $option . '</option>';
}
echo '</select>';
break;
}
}
echo '</table>';
}
开发者ID:poolieweb,项目名称:LawStaticAthena,代码行数:40,代码来源:theme-testimeta.php
示例15: hero_unit_shortcode
function hero_unit_shortcode($atts, $content = null)
{
extract(shortcode_atts(array('title' => '', 'text' => '', 'btn_text' => theme_locals('read_more'), 'btn_link' => '', 'btn_style' => '', 'btn_size' => '', 'target' => '', 'custom_class' => ''), $atts));
$output = '<div class="hero-unit ' . $custom_class . '">';
if ($title != "") {
$output .= '<h1>';
$output .= $title;
$output .= '</h1>';
}
if ($text != "") {
$output .= '<p>';
$output .= $text;
$output .= '</p>';
}
if ($btn_link != "") {
$output .= '<div class="btn-align"><a href="' . $btn_link . '" title="' . $btn_text . '" class="btn btn-' . $btn_style . ' btn-' . $btn_size . ' btn-primary" target="' . $target . '">';
$output .= $btn_text;
$output .= '</a></div>';
}
$output .= '</div><!-- .hero-unit (end) -->';
return $output;
}
开发者ID:poolieweb,项目名称:LawStaticAthena,代码行数:22,代码来源:hero_unit.php
示例16: elegance_widgets_init
function elegance_widgets_init()
{
// Sidebar Widget
// Location: the sidebar
register_sidebar(array('name' => theme_locals("sidebar"), 'id' => 'main-sidebar', 'description' => theme_locals("sidebar_desc"), 'before_widget' => '<div id="%1$s" class="widget">', 'after_widget' => '</div>', 'before_title' => '<h3>', 'after_title' => '</h3>'));
// Cart Holder Widget
// Location: the sidebar
register_sidebar(array('name' => __("Cart Holder", "themeWoo"), 'id' => 'cart-holder', 'description' => __("Widget for cart in Header", "themeWoo"), 'before_widget' => '<div id="%1$s" class="cart-holder">', 'after_widget' => '</div>', 'before_title' => '<h3>', 'after_title' => '</h3>'));
// Product page widget area
// Location: bottom of the product page
register_sidebar(array('name' => __("Product Page", "themeWoo"), 'id' => 'product-page', 'description' => __("Product page widget area", "themeWoo"), 'before_widget' => '<div class="product-page">', 'after_widget' => '</div>', 'before_title' => '<h2>', 'after_title' => '</h2>'));
// Footer Widget Area 1
// Location: at the top of the footer, above the copyright
register_sidebar(array('name' => theme_locals("footer_1"), 'id' => 'footer-sidebar-1', 'description' => theme_locals("footer_desc"), 'before_widget' => '<div id="%1$s">', 'after_widget' => '</div>', 'before_title' => '<h4>', 'after_title' => '</h4>'));
// Footer Widget Area 2
// Location: at the top of the footer, above the copyright
register_sidebar(array('name' => theme_locals("footer_2"), 'id' => 'footer-sidebar-2', 'description' => theme_locals("footer_desc"), 'before_widget' => '<div id="%1$s">', 'after_widget' => '</div>', 'before_title' => '<h4>', 'after_title' => '</h4>'));
// Footer Widget Area 3
// Location: at the top of the footer, above the copyright
register_sidebar(array('name' => theme_locals("footer_3"), 'id' => 'footer-sidebar-3', 'description' => theme_locals("footer_desc"), 'before_widget' => '<div id="%1$s">', 'after_widget' => '</div>', 'before_title' => '<h4>', 'after_title' => '</h4>'));
// Footer Widget Area 4
// Location: at the top of the footer, above the copyright
register_sidebar(array('name' => theme_locals("footer_4"), 'id' => 'footer-sidebar-4', 'description' => theme_locals("footer_desc"), 'before_widget' => '<div id="%1$s">', 'after_widget' => '</div>', 'before_title' => '<h4>', 'after_title' => '</h4>'));
}
开发者ID:pearlohuy,项目名称:megashop,代码行数:24,代码来源:sidebar-init.php
示例17: elegance_widgets_init
function elegance_widgets_init()
{
// Sidebar Widget
// Location: the sidebar
register_sidebar(array('name' => theme_locals("sidebar"), 'id' => 'main-sidebar', 'description' => theme_locals("sidebar_desc"), 'before_widget' => '<div id="%1$s" class="widget">', 'after_widget' => '</div>', 'before_title' => '<h3>', 'after_title' => '</h3>'));
// Header Widget Area
// Location: at the top of pages
register_sidebar(array('name' => __('Header', getCurrentTheme()), 'id' => 'header', 'description' => __('Header widget area', getCurrentTheme()), 'before_widget' => '<div id="%1$s" class="header-widget">', 'after_widget' => '</div>', 'before_title' => '<h4>', 'after_title' => '</h4>'));
// Cart Holder Widget
// Location: the sidebar
register_sidebar(array('name' => __("Cart Holder", "themeWoo"), 'id' => 'cart-holder', 'description' => __("Widget for cart in Header", "themeWoo"), 'before_widget' => '<div id="%1$s" class="cart-holder">', 'after_widget' => '</div></div>', 'before_title' => '<h3>', 'after_title' => '</h3><div class="widget_shopping_cart_content">'));
// Footer Widget Area 1
// Location: at the top of the footer, above the copyright
register_sidebar(array('name' => theme_locals("footer_1"), 'id' => 'footer-sidebar-1', 'description' => theme_locals("footer_desc"), 'before_widget' => '<div id="%1$s" class="footer-widget-item">', 'after_widget' => '</div>', 'before_title' => '<h3>', 'after_title' => '</h3>'));
// Footer Widget Area 2
// Location: at the top of the footer, above the copyright
register_sidebar(array('name' => theme_locals("footer_2"), 'id' => 'footer-sidebar-2', 'description' => theme_locals("footer_desc"), 'before_widget' => '<div id="%1$s" class="footer-widget-item">', 'after_widget' => '</div>', 'before_title' => '<h3>', 'after_title' => '</h3>'));
// Footer Widget Area 3
// Location: at the top of the footer, above the copyright
register_sidebar(array('name' => theme_locals("footer_3"), 'id' => 'footer-sidebar-3', 'description' => theme_locals("footer_desc"), 'before_widget' => '<div id="%1$s" class="footer-widget-item">', 'after_widget' => '</div>', 'before_title' => '<h3>', 'after_title' => '</h3>'));
// Footer Widget Area 4
// Location: at the top of the footer, above the copyright
register_sidebar(array('name' => theme_locals("footer_4"), 'id' => 'footer-sidebar-4', 'description' => theme_locals("footer_desc"), 'before_widget' => '<div id="%1$s" class="footer-widget-item">', 'after_widget' => '</div>', 'before_title' => '<h3>', 'after_title' => '</h3>'));
}
开发者ID:kittu57,项目名称:Access-story,代码行数:24,代码来源:sidebar-init.php
示例18: my_post_type_team
function my_post_type_team() {
register_post_type( 'team',
array(
'label' => theme_locals("our_team"),
'singular_label' => theme_locals("our_team"),
'_builtin' => false,
// 'exclude_from_search' => true, // Exclude from Search Results
'capability_type' => 'page',
'public' => true,
'show_ui' => true,
'show_in_nav_menus' => false,
'menu_position' => 5,
'rewrite' => array(
'slug' => 'team-view',
'with_front' => FALSE,
),
'supports' => array(
'title',
'custom-fields',
'editor',
'thumbnail')
)
);
}
开发者ID:kevinreilly,项目名称:mendelements.com,代码行数:24,代码来源:theme-init.php
示例19: of_get_option
<div id="footer-text" class="footer-text">
<?php
$myfooter_text = of_get_option('footer_text');
?>
<?php
if ($myfooter_text) {
?>
<?php
echo of_get_option('footer_text');
?>
<?php
} else {
?>
© <?php
echo date('Y');
?>
| <a href="<?php
echo home_url();
?>
/privacy-policy/" title="<?php
echo theme_locals('privacy_policy');
?>
"><?php
echo theme_locals("privacy_policy");
?>
</a>
<?php
}
?>
</div>
开发者ID:AdrianBav,项目名称:oilandgas,代码行数:31,代码来源:static-footer-text.php
示例20: shortcode_carousel
function shortcode_carousel($atts, $content = null) {
extract(shortcode_atts(array(
'title' => '',
'num' => '8',
'type' => '',
'thumb' => 'true',
'thumb_width' => '220',
'thumb_height' => '180',
'more_text_single' => theme_locals('read_more'),
'category' => '',
'custom_category' => '',
'excerpt_count' => '12',
'date' => '',
'author' => '',
'min_items' => '3',
'spacer' => '18',
'custom_class' => ''
), $atts));
$template_url = get_stylesheet_directory_uri();
// check what type of post user selected
switch ($type) {
case 'blog':
$type_post = '';
break;
case 'portfolio':
$type_post = 'portfolio';
break;
case 'testimonial':
$type_post = 'testi';
break;
}
$output = '<div class="carousel-wrap '.$custom_class.'">';
if ($title != '') {
$output .= '<h2>'.$title.'</h2>';
}
$output .= '<div id="carousel-'. $type .'" class="es-carousel-wrapper">';
$output .= '<div class="es-carousel">';
$output .= '<ul class="es-carousel_list unstyled">';
global $post;
global $my_string_limit_words;
$args = array(
'post_type' => $type_post,
'category_name' => $category,
$type_post . '_category' => $custom_category,
'numberposts' => $num,
'orderby' => 'post_date',
'order' => 'DESC'
);
$latest = get_posts($args);
$i = 0;
foreach($latest as $post) {
setup_postdata($post);
$excerpt = get_the_excerpt();
$format = get_post_format();
$attachment_url = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'full' );
$url = $attachment_url['0'];
$image = aq_resize($url, $thumb_width, $thumb_height, true);
$link_format_url = get_post_meta(get_the_ID(), 'tz_link_url', true);
$output .= '<li class="es-carousel_li '.$format.'">';
if ($thumb == 'true') {
if (has_post_thumbnail($post->ID) && $format == 'image') {
$prettyType = 'prettyPhoto';
$output .= '<figure class="featured-thumbnail">';
$output .= '<a href="'.get_permalink($post->ID).'" title="'.get_the_title($post->ID).'">';
$output .= '<img src="'.$image.'" alt="'.get_the_title($post->ID).'" />';
$output .= '</a></figure>';
} elseif ( $format != 'video' && $format != 'audio') {
$thumbid = 0;
$thumbid = get_post_thumbnail_id($post->ID);
$images = get_children( array(
'orderby' => 'menu_order',
'order' => 'ASC',
'post_type' => 'attachment',
'post_parent' => $post->ID,
'post_mime_type' => 'image',
'post_status' => null,
'numberposts' => -1
) );
if ( $images ) {
$k = 0;
//looping through the images
foreach ( $images as $attachment_id => $attachment ) {
//if( $attachment->ID == $thumbid ) continue;
$image_attributes = wp_get_attachment_image_src( $attachment_id, 'full' ); // returns an array
$img = aq_resize($image_attributes[0], $thumb_width, $thumb_height, true); //resize & crop img
//.........这里部分代码省略.........
开发者ID:kevinreilly,项目名称:mendelements.com,代码行数:101,代码来源:carousel.php
<
|
请发表评论