本文整理汇总了PHP中vp_option函数的典型用法代码示例。如果您正苦于以下问题:PHP vp_option函数的具体用法?PHP vp_option怎么用?PHP vp_option使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了vp_option函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: jobboard_option
function jobboard_option($name)
{
if (function_exists('vp_option')) {
return vp_option("jobboard_option." . $name);
}
//endif;
}
示例2: vp_pf_option
function vp_pf_option($key, $default = null)
{
if (!function_exists('vp_option')) {
return $default;
}
return vp_option(VP_PF_OPTION_KEY . '.' . $key, $default);
}
示例3: charityHomeLayoutSetUp
function charityHomeLayoutSetUp()
{
$home_1_select = vp_option("vpt_option.charity_home_1_select");
$home_2_select = vp_option("vpt_option.charity_home_2_select");
$home_3_select = vp_option("vpt_option.charity_home_3_select");
$home_shoplanding = vp_option("vpt_option.charity_home_shoplanding");
$home_layout = vp_option("vpt_option.home_layout");
switch ($home_layout) {
case "one":
update_option("show_on_front", "page");
update_option('page_on_front', $home_1_select);
break;
case "two":
update_option("show_on_front", "page");
update_option('page_on_front', $home_2_select);
break;
case "three":
update_option("show_on_front", "page");
update_option('page_on_front', $home_3_select);
break;
case "shoplanding":
update_option("show_on_front", "page");
update_option('page_on_front', $home_shoplanding);
break;
default:
$front_page_id = get_option('page_on_front');
$templatePage = get_post_meta($front_page_id, "_wp_page_template", true);
if ($templatePage == "charity-home-one.php" || $templatePage == "charity-home-two.php" || $templatePage == "charity-home-three.php" || $templatePage == "charity-shop-landing.php") {
update_option("show_on_front", "posts");
update_option('page_on_front', "");
}
break;
}
}
示例4: get_option
public function get_option($name, $get_default = true)
{
$option = vp_option("wp_tiles." . $name);
if ($get_default && is_null($option)) {
$option = $this->get_defaults($name);
}
return apply_filters('wp_tiles_option_' . $name, $option, $get_default);
}
示例5: charity_login_logo
function charity_login_logo() {
$site_logo = (vp_option('vpt_option.site_logo')) ? vp_option('vpt_option.site_logo') : get_stylesheet_directory_uri() . "/assets/img/logo.png";
$color = (vp_option('vpt_option.theme_color')) ? vp_option('vpt_option.theme_color') : '#ffffff';
echo "<style type='text/css'>
body.login div#login h1 a{ background-image: url('" . esc_url($site_logo) . "') !important; }
body.login{ background-color: " . esc_attr($color) . "!important; }
</style>";
}
示例6: charityProjectPostDetailsLayout
function charityProjectPostDetailsLayout()
{
$layoutOption = vp_option("vpt_option.charity-project-single-layout");
if ($layoutOption == "sidebar") {
get_template_part("content/project/project", "detail-withsidebar");
} else {
get_template_part("content/project/project", "detail");
}
}
示例7: charity_global_donation_button_shortcode
function charity_global_donation_button_shortcode($atts, $content = null)
{
$causesId = vp_option("vpt_option.charity_global_donation_cause_id");
if (!empty($causesId)) {
$content = '<a data-toggle="modal" href="javascript:;" data-id="' . $causesId . '" data-target=".donate-form" class="btn btn-default charity-global-causes-' . $causesId . ' charity-donation-button">' . __("DONATE NOW", "charity") . '</a>';
} else {
$content = __("Select causes for global donation", "charity");
}
return $content;
}
示例8: jeg_load_shortcode
function jeg_load_shortcode()
{
/** General shortcode */
new VP_ShortcodeGenerator(array('name' => 'generalshortcode', 'template' => locate_template(array('admin/shortcode/generalshortcode.php'), true, true), 'modal_title' => 'Jkreativ General Shortocde', 'button_title' => 'Jkreativ General Shortocde', 'types' => array('post', 'page', 'portfolio'), 'included_pages' => array(''), 'main_image' => get_template_directory_uri() . '/assets/img/jshortcode.png', 'sprite_image' => get_template_directory_uri() . '/assets/img/jshortcode.png'));
/** Page builder Shortcode **/
if (vp_option('joption.enable_section_builder')) {
new VP_ShortcodeGenerator(array('name' => 'sectionshortcode', 'template' => locate_template(array('admin/shortcode/sectionshortcode.php'), true, true), 'modal_title' => 'Jkreativ Section Shortcode', 'button_title' => 'Jkreativ Section Shortcode', 'types' => array('page', 'portfolio'), 'included_pages' => array(''), 'main_image' => get_template_directory_uri() . '/assets/img/sshortcode.png', 'sprite_image' => get_template_directory_uri() . '/assets/img/sshortcode.png'));
}
/** Page builder Shortcode **/
new VP_ShortcodeGenerator(array('name' => 'creditshortcode', 'template' => locate_template(array('admin/shortcode/creditshortcode.php'), true, true), 'modal_title' => 'Jkreativ Credit Shortocde', 'button_title' => 'Jkreativ Credit Shortocde', 'types' => array(), 'included_pages' => array('toplevel_page_jeg_option'), 'main_image' => get_template_directory_uri() . '/assets/img/cshortcode.png', 'sprite_image' => get_template_directory_uri() . '/assets/img/cshortcode.png'));
}
示例9: setup
function setup()
{
$options = vp_option('vpt_option');
add_theme_support('soil-clean-up');
// Enable clean up from Soil
add_theme_support('soil-relative-urls');
// Enable relative URLs from Soil
add_theme_support('soil-nice-search');
// Enable nice search from Soil
add_theme_support('soil-google-analytics', $options['ga_id']);
// Enable Google Analytics
//add_theme_support('soil-jquery-cdn'); // Enable jQuery from the Google CDN
//add_theme_support('soil-js-to-footer'); // Enable js to footer
add_theme_support('soil-nav-walker');
// Enable clean nav walker
add_theme_support('bootstrap-gallery');
// Enable Bootstrap Gallery
// Make theme available for translation
// Community translations can be found at https://github.com/roots/sage-translations
load_theme_textdomain('sage', get_template_directory() . '/lang');
// Enable plugins to manage the document title
// http://codex.wordpress.org/Function_Reference/add_theme_support#Title_Tag
add_theme_support('title-tag');
// Register wp_nav_menu() menus
// http://codex.wordpress.org/Function_Reference/register_nav_menus
register_nav_menus(['primary_navigation' => __('Primary Navigation', 'sage')]);
// Add post thumbnails
// http://codex.wordpress.org/Post_Thumbnails
// http://codex.wordpress.org/Function_Reference/set_post_thumbnail_size
// http://codex.wordpress.org/Function_Reference/add_image_size
add_theme_support('post-thumbnails');
add_image_size('slider', 1200, 600, true);
//update_option( 'medium_crop', 1 ); //Turn on image crop at medium size
// Add post formats
// http://codex.wordpress.org/Post_Formats
//add_theme_support('post-formats', ['aside', 'gallery', 'link', 'image', 'quote', 'video', 'audio']);
// Add HTML5 markup for captions
// http://codex.wordpress.org/Function_Reference/add_theme_support#HTML5
add_theme_support('html5', ['caption', 'comment-form', 'comment-list', 'gallery', 'search-form']);
// Tell the TinyMCE editor to use a custom stylesheet
add_editor_style(Assets\asset_path('styles/editor-style.css'));
// Allow shortcode execution in widgets
add_filter('widget_text', 'do_shortcode');
// Gets rid of the word "Archive:" in front of the Archive title
add_filter('get_the_archive_title', function ($title) {
if (is_post_type_archive()) {
$title = post_type_archive_title();
}
return $title;
});
//remove_filter( 'the_content', 'wpautop' );
}
示例10: footer
function footer()
{
$layoutOption = vp_option("vpt_option.footer_layout");
$slug = "content/footer/one";
switch ($layoutOption) {
case "two":
$slug = "content/footer/two";
break;
case "three":
$slug = "content/footer/three";
break;
default:
$slug = "content/footer/one";
break;
}
get_template_part($slug);
}
示例11: bgImage
function bgImage($args)
{
if (!empty($args['template_file'])) {
$id = charity_get_page_template($args['template_file'], $by = "ID");
} else {
global $post;
$id = $post->ID;
}
$bgImage = vp_metabox('breadcrumb.image', '', $id);
$bgDefaultImage = vp_option('vpt_option.img_404');
if (!empty($bgImage)) {
printf('style="background-image:url(%s)"', $bgImage);
} else {
printf('style="background-image:url(%s)"', $bgDefaultImage);
//default image
}
}
示例12: option
/**
* Access a VafPress option with optional default value
*/
public static function option($name, $default = null)
{
$option = vp_option('wpurp_option.' . $name);
if (is_null($default)) {
$default = self::get()->helper('vafpress_menu')->defaults($name);
}
// Chicory specific check
if ('partners_integrations_chicory_enable' == $name && '1' == $option) {
$option = vp_option('wpurp_option.partners_integrations_chicory_terms');
if (count($option) == 0) {
$option = '';
} else {
$option = '1';
}
}
return is_null($option) ? $default : $option;
}
示例13: charity_vc_become_volunteer
function charity_vc_become_volunteer($atts, $content = null)
{
extract(shortcode_atts(array('step_1' => '', 'title_1' => '', 'content_1' => '', 'step_2' => '', 'title_2' => '', 'content_2' => '', 'step_3' => '', 'title_3' => '', 'content_3' => '', 'step_4' => '', 'title_4' => '', 'content_4' => ''), $atts, 'volunteer'));
$return = "";
$return .= "<section class='process-section text-center'>";
$return .= "<header class='page-header section-header clearfix'>";
$return .= "<h2>" . vp_option('vpt_option.ch_volunteer_process_title') . "</h2>";
$return .= "</header>";
$return .= "<div class='row processes'>";
$return .= do_shortcode("[volunteer step='" . $step_1 . "' title='" . $title_1 . "']" . $content_1 . "[/volunteer]");
$return .= do_shortcode("[volunteer step='" . $step_2 . "' title='" . $title_2 . "']" . $content_2 . "[/volunteer]");
$return .= do_shortcode("[volunteer step='" . $step_3 . "' title='" . $title_3 . "']" . $content_3 . "[/volunteer]");
$return .= do_shortcode("[volunteer step='" . $step_4 . "' title='" . $title_4 . "']" . $content_4 . "[/volunteer]");
$return .= do_shortcode("[charity_join_today_button][/charity_join_today_button]");
$return .= do_shortcode("[join_today_form][contact-form-7 id='356' title='Join Today'][/join_today_form]");
$return .= "</div>";
$return .= "</section>";
return $return;
}
示例14: wpbpscripts_and_styles
function wpbpscripts_and_styles()
{
if (!is_admin()) {
// register stylesheets and js
wp_register_style('wpbp-styles', CSS . 'wpbp.css', '', '', 'all');
wp_register_script('wpbp-scripts', JS . 'wpbp.js', array('jquery'), '', true);
// enqueue it all
wp_enqueue_style('wpbp-styles');
wp_enqueue_script('wpbp-scripts');
if (is_singular() && comments_open() && get_option('thread_comments')) {
wp_enqueue_script('comment-reply');
}
// loading Google Fonts if chosen in global theme settings
$font_face = vp_option('wpbp_option.wpbp_body_font_face');
$font_weight = vp_option('wpbp_option.wpbp_body_font_weight');
$font_style = vp_option('wpbp_option.wpbp_body_font_style');
VP_Site_GoogleWebFont::instance()->add($font_face, $font_weight, $font_style);
VP_Site_GoogleWebFont::instance()->register_and_enqueue();
}
}
示例15: singlePage
function singlePage($author_id)
{
$chy_options = array();
$social_icons = vp_option('vpt_option.auther_social_linlk');
if (empty($social_icons)) {
return;
}
foreach ($social_icons as $social_icon) {
$chy_options[$social_icon] = array("title" => __($social_icon, "charity"), "font-class" => "fa fa-" . $social_icon);
}
if (count($chy_options) > 0) {
?>
<ul class="social-icons blog-page-author">
<?php
foreach ($chy_options as $key => $val) {
$this->setLink($key, $val['title'], $author_id, $val['font-class']);
}
?>
</ul>
<?php
}
}