本文整理汇总了PHP中get_option_max函数的典型用法代码示例。如果您正苦于以下问题:PHP get_option_max函数的具体用法?PHP get_option_max怎么用?PHP get_option_max使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_option_max函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getMetaBox
public function getMetaBox()
{
$this->createMetabox(array('id' => MAX_SHORTNAME . '_post_sidebar_metabox', 'title' => __('Sidebar Settings', MAX_SHORTNAME), 'priority' => "default", 'context' => 'side'));
// get the custom sidebars and make a dropdown array
$_sidebar_option_array = get_option_max('sidebar_array');
$_dropdown_array = array('false' => __('Default or no Sidebar', MAX_SHORTNAME));
if (is_array($_sidebar_option_array)) {
foreach ($_sidebar_option_array as $sidebar_value) {
$_s = explode(',', $sidebar_value);
$_dropdown_array[$_s[1]] = $_s[0];
}
}
// Sidebar select
$this->addDropdown(array('id' => MAX_SHORTNAME . '_sidebar_select', 'label' => __('Choose a Sidebar', MAX_SHORTNAME), "options" => $_dropdown_array, "standard" => "false", "desc" => __('Select a sidebar to show on this page or post, when a sidebar is provided for this post or page template. You can create as many sidebars as you like on your Invictus theme settings.', MAX_SHORTNAME)));
}
示例2: gallery_register
function gallery_register()
{
$labels = array('name' => _x('Photos', 'post type general name', MAX_SHORTNAME), 'singular_name' => _x('Photo', 'post type singular name', MAX_SHORTNAME), 'add_new' => _x('Add New', 'gallery', MAX_SHORTNAME), 'add_new_item' => __('Add A New Photo to a Gallery', MAX_SHORTNAME), 'edit_item' => __('Edit Photo', MAX_SHORTNAME), 'new_item' => __('New Photo', MAX_SHORTNAME), 'view_item' => __('View Photo', MAX_SHORTNAME), 'search_items' => __('Search Photos', MAX_SHORTNAME), 'not_found' => __('No Photos found', MAX_SHORTNAME), 'not_found_in_trash' => __('No Photos found in Trash', MAX_SHORTNAME), 'parent_item_colon' => '', 'menu_name' => 'Photos');
// rewrite option for permalinks on custom post-type
$option_rewrite_pt = get_option_max('rewrite_posttype');
$rewrite_posttype = !empty($option_rewrite_pt) ? array('slug' => $option_rewrite_pt) : true;
$args = array('labels' => $labels, 'public' => true, 'show_ui' => true, 'publicly_queryable' => true, 'capability_type' => 'post', 'supports' => array('thumbnail', 'excerpt', 'comments', 'editor', 'title', 'revisions', 'author', 'custom-fields', 'page-attributes'), 'taxonomies' => array('post_tag'), 'menu_position' => 55, 'query_var' => true, 'rewrite' => $rewrite_posttype, 'menu_icon' => 'dashicons-format-gallery');
register_post_type('gallery', $args);
$gal_labels = array('name' => _x('Galleries', 'taxonomy general name', MAX_SHORTNAME), 'singular_name' => _x('Gallery', 'taxonomy singular name', MAX_SHORTNAME), 'search_items' => __('Search Galleries', MAX_SHORTNAME), 'popular_items' => __('Popular Galleries', MAX_SHORTNAME), 'all_items' => __('All Galleries', MAX_SHORTNAME), 'parent_item' => null, 'parent_item_colon' => null, 'edit_item' => __('Edit Galleries', MAX_SHORTNAME), 'update_item' => __('Update Galleries', MAX_SHORTNAME), 'add_new_item' => __('Add New Gallery', MAX_SHORTNAME), 'new_item_name' => __('New Gallery Name', MAX_SHORTNAME), 'separate_items_with_commas' => __('Separate galleries with commas', MAX_SHORTNAME), 'add_or_remove_items' => __('Add or remove Galleries', MAX_SHORTNAME), 'choose_from_most_used' => __('Choose from the most used Galleries', MAX_SHORTNAME), 'menu_name' => __('Galleries', MAX_SHORTNAME));
add_post_type_support('gallery', 'thumbnail');
// rewrite option for permalinks on taxonomy
$option_rewrite_tax = get_option_max('rewrite_taxonomy');
$rewrite_taxonomy = !empty($option_rewrite_tax) ? array('slug' => $option_rewrite_tax) : true;
// register new taxonomy
register_taxonomy(GALLERY_TAXONOMY, "gallery", array("hierarchical" => true, "label" => __('Galleries', MAX_SHORTNAME), "singular_label" => __('Gallery', MAX_SHORTNAME), "labels" => $gal_labels, "rewrite" => $rewrite_taxonomy));
}
示例3: max_widgets_init
function max_widgets_init()
{
$before_title = '<h2 class="widget-title">';
$after_title = '</h2>';
$before_widget = '<aside id="%1$s" class="widget %2$s">';
$after_widget = '</aside>';
$_sidebar_array = array(array("id" => "blog", "name" => __('Blog Sidebar', MAX_SHORTNAME), "description" => __('Blog Sidebar Widget Area', MAX_SHORTNAME)), array("id" => "homepage", "name" => __('Homepage Sidebar', MAX_SHORTNAME), "description" => __('Homepage Widget Area', MAX_SHORTNAME)), array("id" => "blog-post", "name" => __('Blog Post Sidebar', MAX_SHORTNAME), "description" => __('Blog Post Sidebar Widget Area', MAX_SHORTNAME)), array("id" => "gallery-project", "name" => __('Gallery Project Page Sidebar', MAX_SHORTNAME), "description" => __('Gallery Project Page Template Widget Area', MAX_SHORTNAME)), array("id" => "gallery-sortable", "name" => __('Gallery Sortable Sidebar', MAX_SHORTNAME), "description" => __('Gallery Sortable Template Widget Area', MAX_SHORTNAME)), array("id" => "gallery-four", "name" => __('Gallery 4 Column Sidebar', MAX_SHORTNAME), "description" => __('Gallery 4 Column Template Widget Area', MAX_SHORTNAME)), array("id" => "gallery-three", "name" => __('Gallery 3 Column Sidebar', MAX_SHORTNAME), "description" => __('Gallery 3 Column Template Widget Area', MAX_SHORTNAME)), array("id" => "gallery-two", "name" => __('Gallery 2 Column Sidebar', MAX_SHORTNAME), "description" => __('Gallery 2 Column Template Widget Area', MAX_SHORTNAME)), array("id" => "gallery-one", "name" => __('Gallery 1 Column Sidebar', MAX_SHORTNAME), "description" => __('Gallery 1 Column Template Widget Area', MAX_SHORTNAME)), array("id" => "tag", "name" => __('Tag Sidebar', MAX_SHORTNAME), "description" => __('Tag Template Widget Area', MAX_SHORTNAME)), array("id" => "gallery-flickr", "name" => __('Gallery Flickr Sidebar', MAX_SHORTNAME), "description" => __('Gallery Flickr Template Widget Area', MAX_SHORTNAME)), array("id" => "gallery-galleria", "name" => __('Galleria Template Sidebar', MAX_SHORTNAME), "description" => __('Galleria Template Widget Area', MAX_SHORTNAME)), array("id" => "gallery-taxonomy", "name" => __('Gallery Taxonomy Sidebar', MAX_SHORTNAME), "description" => __('Gallery Taxonomy Template Widget Area', MAX_SHORTNAME)), array("id" => "main", "name" => __('Sidebar left Template Sidebar', MAX_SHORTNAME), "description" => __('Sidebar for Custom Template with left sidebar', MAX_SHORTNAME)), array("id" => "search-result", "name" => __('Sidebar Search Result', MAX_SHORTNAME), "description" => __('Sidebar for Search results with left sidebar', MAX_SHORTNAME)), array("id" => "archive-result", "name" => __('Sidebar Archive', MAX_SHORTNAME), "description" => __('Sidebar for Archive with left sidebar', MAX_SHORTNAME)), array("id" => "contact", "name" => __('Sidebar Contact', MAX_SHORTNAME), "description" => __('Sidebar for Contact page with left sidebar', MAX_SHORTNAME)), array("id" => "fullsize-gallery", "name" => __('Sidebar Fullsize Gallery', MAX_SHORTNAME), "description" => __('Sidebar for fullsize gallery templates', MAX_SHORTNAME)), array("id" => "fullsize-video", "name" => __('Sidebar Fullsize Video', MAX_SHORTNAME), "description" => __('Sidebar for fullsize video templates', MAX_SHORTNAME)), array("id" => "fullsize-flickr", "name" => __('Sidebar Fullsize Flickr', MAX_SHORTNAME), "description" => __('Sidebar for fullsize flickr templates', MAX_SHORTNAME)), array("id" => "gallery-lightbox", "name" => __('Sidebar Lightbox Gallery', MAX_SHORTNAME), "description" => __('Sidebar for lightbox gallery templates', MAX_SHORTNAME)));
// get the custom sidebars and make a dropdown array
$_sidebar_option_array = get_option_max('sidebar_array');
if (is_array($_sidebar_option_array)) {
foreach ($_sidebar_option_array as $sidebar_value) {
$_s = explode(',', $sidebar_value);
$_sidebar_array[] = array("id" => $_s[1], "name" => $_s[0], "description" => "");
}
}
// Loop array with sidebars
foreach ($_sidebar_array as $index => $value) {
register_sidebar(array('name' => $value['name'], 'id' => "sidebar-" . $value['id'], 'description' => $value['description'], 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title));
}
}
示例4: max_get_the_excerpt
max_get_the_excerpt(true);
?>
</h2>
<?php
}
?>
<?php
if (has_post_thumbnail($post->ID)) {
$image = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'single-post-thumbnail');
$imageFull = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'full');
$img_excerpt = get_the_excerpt();
$img_title = get_the_title();
$img_alt = get_the_title();
// check wether to choose image or post meta informations on the lightbox
if (get_option_max('general_use_image_meta') == 'true') {
// get the meta from the image information on the media library
$img_title = get_post_field('post_title', get_post_thumbnail_id());
$img_excerpt = get_post_field('post_excerpt', get_post_thumbnail_id());
}
?>
<div class="entry-image">
<a href="<?php
echo $imageFull[0];
?>
" data-rel="prettyPhoto" data-link="<?php
get_permalink($post_id);
?>
" title="<?php
echo strip_tags($img_excerpt);
示例5: max_add_styles
function max_add_styles()
{
if (!is_admin()) {
if (get_option_max("pretty_enable_lightbox", 'false') == 'false') {
wp_enqueue_style('prettyphoto', get_template_directory_uri() . '/js/prettyPhoto/prettyPhoto.css', false, false);
}
wp_enqueue_style('responsive', get_template_directory_uri() . '/css/responsive.css', false, false);
wp_enqueue_style('custom', get_template_directory_uri() . '/css/custom.css', false, false);
wp_enqueue_style('headers', get_template_directory_uri() . '/css/headers.css', false, false);
wp_enqueue_style('fontawesome', get_template_directory_uri() . '/css/fonts/font-awesome.min.css', array(), '3.0.2');
if (get_option_max('menu_mega_menu', 'false') === 'true') {
wp_enqueue_style('megamenu', get_template_directory_uri() . '/css/megamenu.css', false, MAX_VERSION);
}
// load galleria only on galleria page templates
if (is_page_template('template-galleria.php')) {
wp_enqueue_style('galleria-css', get_template_directory_uri() . '/js/galleria/galleria.classic.css', false, false);
}
// get the color file
if (!MAX_DEMO_MODE) {
wp_enqueue_style('color-main', get_template_directory_uri() . '/css/' . get_option_max('color_main', 'black') . '.css', false, MAX_VERSION);
}
}
}
示例6: single_tag_title
<div id="content" role="main">
<header class="entry-header">
<h1 class="page-title"><?php
single_tag_title();
?>
</h1>
</header><!-- .entry-header -->
<?php
// Only get gallery posts
if ($post_type == "gallery") {
$tag_posts = query_posts(array('tag' => get_query_var('tag'), 'post_type' => 'gallery', 'paged' => $paged, 'order' => get_option_max('photo_post_archive_sorting')));
}
// Only get blog posts
if ($post_type == "post") {
$tag_posts = query_posts(array('tag' => get_query_var('tag'), 'post_type' => 'post', 'paged' => $paged));
}
if ($post_type == "gallery") {
// including the loop template tag-loop.inc.php
get_template_part('includes/tag', 'loop.inc');
}
if ($post_type == "post") {
// including the loop template blog-loop.inc.php
get_template_part('includes/blog', 'loop.inc');
}
?>
示例7: max_add_fullwidth_body_class
function max_add_fullwidth_body_class($classes)
{
global $meta;
@($custom_fields = get_post_custom_values('_wp_page_template', $post_id));
$page_template = $custom_fields[0];
// check if we have a full-width nav and fill content is activated
$classes[] = 'fill-content-' . get_option_max("layout_fill_content", 'false');
if (isset($meta[MAX_SHORTNAME . "_page_gallery_fullwidth"]) && $meta[MAX_SHORTNAME . "_page_gallery_fullwidth"] == 'true' || $page_template == 'template-sidebar-fullwidth.php' || $page_template == 'template-fullwidth-no-sidebar.php' || $page_template == 'template-facebook-gallery.php') {
$classes[] = 'fullwidth-content';
}
return $classes;
}
示例8: wp_list_comments
?>
<ol class="commentlist">
<?php
/* Loop through and list the comments. Tell wp_list_comments()
* to use max_comment() to format the comments.
* If you want to overload this in a child theme then you can
* define max_comment() and that will be used instead.
* See max_comment() in doitmax_fw/max_comments.php for more.
*/
wp_list_comments(array('callback' => 'max_comment'));
?>
</ol>
<?php
if (get_comment_pages_count() > 1 && get_option_max('page_comments')) {
// Are there comments to navigate through?
?>
<div class="navigation">
<div class="nav-previous"><?php
previous_comments_link(__('<span class="meta-nav">←</span> Older Comments', MAX_SHORTNAME));
?>
</div>
<div class="nav-next"><?php
next_comments_link(__('Newer Comments <span class="meta-nav">→</span>', MAX_SHORTNAME));
?>
</div>
</div><!-- .navigation -->
<?php
}
// check for comment navigation
示例9: strip_tags
<?php
echo '<span class="excerpt">' . strip_tags(get_the_excerpt()) . '</span>';
?>
<?php
}
?>
</div>
</figcaption>
<?php
}
}
?>
<?php
if (get_option_max('image_always_lightbox') == 'true') {
?>
<a href="<?php
the_permalink();
?>
" class="hover-link-icon"><?php
_e('Link to detail page', MAX_SHORTNAME);
?>
</a>
<?php
}
?>
</figure>
<?php
示例10: get_the_title
echo get_the_title();
?>
| <?php
echo get_bloginfo('name');
?>
" class="twitter-share-button" data-lang="en" data-url="<?php
echo get_permalink($post->ID);
?>
">Tweet</a>
</div>
<?php
}
?>
<?php
if (get_option_max("post_social_google") == 'true') {
// check if google+ should be shown
?>
<!-- Google+ -->
<div class="share-button share-google-plus">
<script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script>
<g:plusone size="medium" href="<?php
echo get_permalink($post->ID);
?>
"></g:plusone>
</div>
<?php
}
?>
</div>
示例11: max_get_cutom_meta_array
*/
global $meta, $post, $post_meta;
$meta = max_get_cutom_meta_array(get_the_ID());
$no_hover = get_option_max('image_show_fade') == 'false' ? ' no-hover' : "";
?>
<!--BEGIN slider -->
<div id="slider-<?php
echo get_the_id();
?>
" class="slides-slider page-slider" data-loader="<?php
echo get_template_directory_uri();
?>
/css/<?php
echo get_option_max('color_main');
?>
/loading.gif">
<?php
$_temp_meta['imgID'] = get_post_thumbnail_id($post->ID);
if (function_exists('has_post_thumbnail') && has_post_thumbnail()) {
?>
<div class="slide<?php
echo $no_hover;
?>
">
<?php
max_get_slider_image($_temp_meta, 'slides-slider', 0, false, false, false);
?>
</div>
示例12: get_option_max
/* <![CDATA[ */
var splashvar = { 'theme': '<?php
echo MAX_SHORTNAME;
?>
', 'cookieset': <?php
echo get_option_max('splash_cookie_set');
?>
, 'cookieexpires' : <?php
echo get_option_max('splash_cookie_expires');
?>
, 'fadeout': <?php
echo $autohide;
?>
, 'timeout': <?php
echo get_option_max('splash_timeout');
?>
, 'fade': <?php
echo get_option_max('splash_fade');
?>
, 'logowidth' : <?php
echo $logo_width;
?>
, 'logoheight' : <?php
echo $logo_height;
?>
, 'enter_text' : '<?php
echo $enter_text;
?>
' };
/* ]]> */
</script>
示例13: get_option_max
// check if there is a excerpt
if (get_option_max('fullsize_featured_text') != '' && $show_fullsize_title == 'true') {
?>
<h2 class="page-description"><?php
echo get_option_max('fullsize_featured_text');
?>
</h2>
<?php
}
?>
</header>
</div>
</div>
<?php
// Check if Homepage Sidebar is activated
if (get_option_max('homepage_show_homepage_sidebar') == 'true') {
/* Get the sidebar if we have set one - otherwise show nothing at all */
$sidebar_string = max_get_custom_sidebar('sidebar-homepage');
/* get the custom or default sidebar name */
// include the sidebar.php template
get_sidebar();
}
?>
</div>
<?php
get_footer();
示例14: googlemap_shortcode
function googlemap_shortcode($atts)
{
extract(shortcode_atts(array('width' => '500px', 'height' => '300px', 'apikey' => get_option_max("general_google_map_api"), 'marker' => '', 'center' => '', 'zoom' => '13'), $atts));
if ($center) {
$setCenter = 'map.setCenter(new GLatLng(' . $center . '), ' . $zoom . ');';
}
if ($marker) {
$setMarker = 'map.addOverlay(new GMarker(new GLatLng(' . $marker . ')));';
}
$rand = rand(1, 100) * rand(1, 100);
return '
<div id="map_canvas_' . $rand . '" class="google_maps_canvas"></div>
<script src="http://maps.google.com/maps?file=api&v=2&sensor=false&key=' . $apikey . '" type="text/javascript"></script>
<script type="text/javascript">
function initialize() {
if (GBrowserIsCompatible()) {
var map = new GMap2(document.getElementById("map_canvas_' . $rand . '"));
' . $setCenter . '
' . $setMarker . '
map.setUIToDefault();
}
}
initialize();
</script>
';
}
示例15: max_login_logo_url
function max_login_logo_url($url)
{
if (get_option_max('admin_login_logo_url')) {
return esc_url(get_option_max('admin_login_logo_url'));
} else {
return $url;
}
}