• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP oxy_get_option函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中oxy_get_option函数的典型用法代码示例。如果您正苦于以下问题:PHP oxy_get_option函数的具体用法?PHP oxy_get_option怎么用?PHP oxy_get_option使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了oxy_get_option函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: oxy_create_logo_css

function oxy_create_logo_css()
{
    // check if we using a logo
    $css = '';
    $header_height = oxy_get_option('header_height');
    switch (oxy_get_option('logo_type')) {
        case 'image':
            $img_id = oxy_get_option('logo_image');
            $img = wp_get_attachment_image_src($img_id, 'full');
            $logo_width = $img[1];
            $logo_height = $img[2];
            $retina = '';
            // check for retina logo
            if ('on' == oxy_get_option('logo_retina')) {
                // set brand logo to be half width & height
                $retina .= 'width:' . $logo_width / 2 . 'px;height:' . $logo_height / 2 . 'px;';
                // use half logo height to calculate header size
                $logo_height = $logo_height / 2;
            }
            $css = oxy_create_header_css($header_height, $logo_height . 'px', $logo_width . 'px', $retina);
            break;
        case 'text':
            $css = oxy_create_header_css($header_height, 36, 'auto');
            break;
    }
    update_option(THEME_SHORT . '-header-css', $css);
}
开发者ID:vanie3,项目名称:appland,代码行数:27,代码来源:backend.php


示例2: current_screen

 public function current_screen($current_screen)
 {
     if ('nav-menus' === $current_screen->base) {
         wp_enqueue_style('oxy-mega-menu', OXY_MEGA_MENU_URI . 'assets/css/oxy-mega-menu.css');
         if ('on' === oxy_get_option('ajax_menu_save')) {
             wp_enqueue_script('oxy-ajax-save-menu', OXY_MEGA_MENU_URI . 'assets/js/ajax-save-menu.js', array('jquery'));
         }
         // Make sure Mega Menu is installed
         $menus = get_posts(array('post_type' => 'oxy_mega_menu'));
         if (count($menus) === 0) {
             // Create post object
             $my_post = array('post_title' => 'Mega Menu', 'post_content' => '', 'post_status' => 'publish', 'post_type' => 'oxy_mega_menu');
             // Insert the post into the database
             wp_insert_post($my_post);
         }
         $menus = get_posts(array('post_type' => 'oxy_mega_columns'));
         if (count($menus) === 0) {
             $columns = array('col-md-3' => __('One Quarter Column (1/4)', 'lambda-admin-td'), 'col-md-4' => __('One Third Column (1/3)', 'lambda-admin-td'));
             foreach ($columns as $content => $title) {
                 // Create post object
                 $column_post = array('post_title' => $title, 'post_content' => $content, 'post_status' => 'publish', 'post_type' => 'oxy_mega_columns');
                 // Insert the post into the database
                 wp_insert_post($column_post);
             }
         }
     }
 }
开发者ID:ntngiri,项目名称:Wordpress-dhaba,代码行数:27,代码来源:OxygennaMegaMenu.php


示例3: oxy_sign_up

function oxy_sign_up()
{
    if (isset($_POST['nonce'])) {
        if (wp_verify_nonce($_POST['nonce'], 'oxygenna-sign-me-up-nonce')) {
            header('Content-Type: application/json');
            $resp = new stdClass();
            $user_email = $_POST['email'];
            $resp->email = $user_email;
            if (filter_var($user_email, FILTER_VALIDATE_EMAIL) !== false) {
                //create the API from the stored key
                $api = new MCAPI(oxy_get_option('api_key'));
                // The list the user will subscribe to
                $list_id = oxy_get_option('list_id');
                $api->listSubscribe($list_id, $user_email);
                if ($api->errorCode) {
                    $resp->status = 'error';
                    $resp->message = __('Error registering', THEME_FRONT_TD);
                } else {
                    $resp->status = 'ok';
                    $resp->message = __('Registered', THEME_FRONT_TD);
                }
            } else {
                $resp->status = 'error';
                $resp->message = __('Invalid email', THEME_FRONT_TD);
            }
            echo json_encode($resp);
            die;
        }
    }
}
开发者ID:vanie3,项目名称:appland,代码行数:30,代码来源:mailchimp.php


示例4: current_screen

 public function current_screen($current_screen)
 {
     if ('nav-menus' === $current_screen->base) {
         wp_enqueue_style('oxy-mega-menu', OXY_MEGA_MENU_URI . 'assets/css/oxy-mega-menu.css');
         if ('on' === oxy_get_option('ajax_menu_save')) {
             wp_enqueue_script('oxy-ajax-save-menu', OXY_MEGA_MENU_URI . 'assets/js/ajax-save-menu.js', array('jquery'));
         }
     }
 }
开发者ID:rinodung,项目名称:wordpress-demo,代码行数:9,代码来源:OxygennaMegaMenu.php


示例5: load_select_data

 function load_select_data($database)
 {
     // get data
     $data = array();
     switch ($database) {
         case 'taxonomy':
             if (isset($this->_field['taxonomy'])) {
                 if (isset($this->_field['blank_label'])) {
                     $this->_field['blank'] = $this->_field['blank_label'];
                 }
                 $data = get_categories(array('orderby' => 'name', 'hide_empty' => '0', 'taxonomy' => $this->_field['taxonomy']));
             }
             break;
         case 'slideshow':
             $this->_field['blank'] = __('Select a Slideshow', THEME_ADMIN_TD);
             $data = get_categories(array('orderby' => 'name', 'hide_empty' => '0', 'taxonomy' => 'oxy_slideshow_categories'));
             break;
         case 'get_option':
             $options = get_option(THEME_SHORT . '-options');
             if (isset($options['unregistered'][$this->_field['option']])) {
                 $data = oxy_get_option($this->_field['option']);
                 $unregistered = oxy_get_option('unregistered');
                 $data = $options['unregistered'][$this->_field['option']];
             } else {
                 $data = null;
             }
             break;
         case 'staff_featured':
             $this->_field['blank'] = __('Select a Staff member', THEME_ADMIN_TD);
             $posts = get_posts("showposts=-1&post_type=oxy_staff");
             foreach ($posts as $staff) {
                 $data[$staff->post_title] = $staff->ID;
             }
             break;
         case 'social_icons':
             $data = (include OPTIONS_DIR . 'icons/social.php');
             break;
         case 'categories':
             $this->_field['blank'] = __('all categories', THEME_ADMIN_TD);
             $data = get_categories(array('orderby' => 'name', 'hide_empty' => '0'));
             break;
         case 'portfolios':
             $this->_field['blank'] = __('Select a Portfolio', THEME_ADMIN_TD);
             $data = get_categories(array('orderby' => 'name', 'hide_empty' => '0', 'taxonomy' => 'oxy_portfolio_categories'));
             break;
         default:
             $data = array();
             break;
     }
     return $data;
 }
开发者ID:vanie3,项目名称:appland,代码行数:51,代码来源:select.php


示例6: get_header

<?php

/**
 * Displays the archive for oxy_portfolio_image custom post type
 *
 * @package Lambda
 * @subpackage Frontend
 * @since 0.1
 *
 * @copyright (c) 2015 Oxygenna.com
 * @license http://wiki.envato.com/support/legal-terms/licensing-terms/
 * @version 1.17.0
 */
get_header();
$page = oxy_get_option('portfolio_archive_page');
if (!empty($page)) {
    global $post;
    $post = get_post($page);
    setup_postdata($post);
    oxy_page_header($post->ID);
    get_template_part('partials/content', 'page');
    wp_reset_postdata();
}
get_footer();
开发者ID:ntngiri,项目名称:Wordpress-dhaba,代码行数:24,代码来源:archive-oxy_portfolio_image.php


示例7: oxy_get_option

<?php

/**
 * Adds navigation for single post
 *
 * @package Omega
 * @subpackage Admin
 * @since 0.1
 *
 * @copyright (c) 2014 Oxygenna.com
 * @license **LICENSE**
 * @version 1.7.3
 */
$extra_post_class = oxy_get_option('blog_post_icons') == 'on' ? 'post-showinfo' : '';
?>
<nav id="nav-below" class="post-navigation <?php 
echo $extra_post_class;
?>
">
    <ul class="pager">
        <?php 
if (get_previous_post()) {
    ?>
            <li class="previous">
                <a class="btn btn-primary btn-icon btn-icon-left" rel="prev" href="<?php 
    echo get_permalink(get_adjacent_post(false, '', true));
    ?>
">
                    <i class="fa fa-angle-left"></i>
                    <?php 
    _e('Previous', 'omega-td');
开发者ID:rinodung,项目名称:wordpress-demo,代码行数:31,代码来源:nav-single.php


示例8: the_author

 * @license http://wiki.envato.com/support/legal-terms/licensing-terms/
 * @version 1.2.2
 */
?>
<small class="post-extras">

    <i class="icon-user"></i>
    <?php 
the_author();
?>
    <i class="icon-calendar"></i>
    <?php 
the_time(get_option('date_format'));
?>
    <?php 
if (has_tag() && oxy_get_option('blog_tags') == 'on') {
    ?>
    <i class="icon-tags"></i>
    <?php 
    the_tags($before = null, $sep = ', ', $after = '');
    ?>
    <?php 
}
?>
    <?php 
if (has_category()) {
    ?>
    <i class="icon-bookmark"></i>
    <?php 
    the_category(', ');
    ?>
开发者ID:vanie3,项目名称:appland,代码行数:31,代码来源:post-extras.php


示例9: oxy_get_option

}
$allow_comments = oxy_get_option('site_comments');
?>

<?php 
if (oxy_get_option('related_portfolio_items') === 'on') {
    ?>
    <?php 
    get_template_part('partials/portfolio/portfolio-related');
}
?>


<?php 
if ($allow_comments === 'portfolio' || $allow_comments === 'all') {
    ?>
<section class="section <?php 
    echo oxy_get_option('portfolio_comments_swatch');
    ?>
">
    <div class="container">
        <div class="row element-normal-top element-normal-bottom">
            <?php 
    comments_template('', true);
    ?>
        </div>
    </div>
</section>
<?php 
}
get_footer();
开发者ID:rinodung,项目名称:wordpress-demo,代码行数:31,代码来源:single-oxy_portfolio_image.php


示例10: oxy_get_option

<?php

$margin_top = oxy_get_option('template_margin');
?>

<section class="section">
    <div class="container">
        <div class="row element-top-<?php 
echo $margin_top;
?>
">
            <div class="col-md-8 col-md-offset-2">

开发者ID:ntngiri,项目名称:Wordpress-dhaba,代码行数:12,代码来源:global-page-top-fullwidth.php


示例11: get_user_by

 * Displays the main body of the theme
 *
 * @package Omega
 * @subpackage Frontend
 * @since 0.1
 *
 * @copyright (c) 2014 Oxygenna.com
 * @license http://wiki.envato.com/support/legal-terms/licensing-terms/
 * @version 1.7.3
 */
// get the author name
if (get_query_var('author_name')) {
    $author = get_user_by('slug', get_query_var('author_name'));
} else {
    $author = get_userdata(get_query_var('author'));
}
get_header();
oxy_blog_header(get_the_author_meta('display_name', $author->ID), null);
// if masonry option set then use masonry option for name otherwise use blog style
$name = oxy_get_option('blog_masonry') === 'no-masonry' ? oxy_get_option('blog_style') : oxy_get_option('blog_masonry');
?>
<section class="section <?php 
echo oxy_get_option('blog_swatch');
?>
">
    <?php 
get_template_part('partials/blog/list', $name);
?>
</section>
<?php 
get_footer();
开发者ID:rinodung,项目名称:wordpress-demo,代码行数:31,代码来源:author.php


示例12: oxy_read_more_link

function oxy_read_more_link($more_link, $more_link_text)
{
    // remove #more
    $more_link = preg_replace('|#more-[0-9]+|', '', $more_link);
    return str_replace($more_link_text, oxy_get_option('blog_readmore'), $more_link);
}
开发者ID:vanie3,项目名称:appland,代码行数:6,代码来源:frontend.php


示例13: oxy_get_option

    echo oxy_get_option('product_directionnav');
    ?>
" data-flex-directions-type="<?php 
    echo oxy_get_option('product_directionnavtype');
    ?>
" data-flex-speed="<?php 
    echo oxy_get_option('product_speed');
    ?>
" data-flex-controls="<?php 
    echo oxy_get_option('product_showcontrols');
    ?>
" data-flex-slideshow="<?php 
    echo oxy_get_option('product_autostart');
    ?>
" data-flex-duration="<?php 
    echo oxy_get_option('product_duration');
    ?>
">
        <ul class="slides product-gallery">
            <?php 
    foreach ($image_ids as $image_id) {
        $thumb = wp_get_attachment_image_src($image_id, 'shop_thumbnail');
        $single = wp_get_attachment_image_src($image_id, 'shop_single');
        $full = wp_get_attachment_image_src($image_id, 'full');
        ?>
                <li data-thumb="<?php 
        echo $thumb[0];
        ?>
">
                    <figure>
                        <img src="<?php 
开发者ID:ntngiri,项目名称:Wordpress-dhaba,代码行数:31,代码来源:product-image.php


示例14: get_post_meta

 * @copyright (c) 2015 Oxygenna.com
 * @license **LICENSE**
 * @version 1.17.0
 */
global $post;
$image = get_post_meta($post->ID, THEME_SHORT . '_masonry_image', true);
if (empty($image)) {
    $image_attachment = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'full');
    if (isset($image_attachment[0])) {
        $image = $image_attachment[0];
    }
}
$width = get_post_meta($post->ID, THEME_SHORT . '_masonry_width', true);
$item_style = oxy_get_option('blog_masonry_style');
$text_align = oxy_get_option('blog_masonry_text_align');
$title_tag = oxy_get_option('blog_masonry_title_tag');
$format = get_post_format();
if ($format !== 'quote' && $format !== 'link') {
    $format = 'standard';
}
?>
<div class="post-masonry masonry-item masonry-<?php 
echo esc_attr($width);
?>
" data-menu-order="<?php 
echo esc_attr($masonry_count);
?>
">
    <div class="post-masonry-inner <?php 
echo esc_attr(implode(' ', $classes));
?>
开发者ID:ntngiri,项目名称:Wordpress-dhaba,代码行数:31,代码来源:post.php


示例15: get_permalink

                    <a href="<?php 
    echo get_permalink($prev->ID);
    ?>
">
                        <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100">
                            <g>
                                <polyline fill="none" stroke-width="3" stroke-miterlimit="10" points="68.692,16.091 33.146,50 68.692,83.906   "/>
                            </g>
                        </svg>
                    </a>
                </li>
            <?php 
}
?>
            <?php 
$page = oxy_get_option('portfolio_page');
?>
            <?php 
if (!empty($page)) {
    ?>
                <li>
                    <a href="<?php 
    echo get_permalink($page);
    ?>
">
                        <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100">
                                <g>
                                    <rect x="15.958" y="15" fill="none" stroke-width="3" stroke-miterlimit="10" width="70" height="70"/>
                                    <line fill="none" stroke-width="3" stroke-miterlimit="10" x1="15.958" y1="61.655" x2="85.958" y2="61.655"/>
                                    <line fill="none" stroke-width="3" stroke-miterlimit="10" x1="15.958" y1="38.345" x2="85.958" y2="38.345"/>
                                    <line fill="none" stroke-width="3" stroke-miterlimit="10" x1="62.632" y1="15" x2="62.632" y2="85"/>
开发者ID:ntngiri,项目名称:Wordpress-dhaba,代码行数:31,代码来源:heading-portfolio.php


示例16: get_template_part

        <?php 
if (!is_search()) {
    if ($video_shortcode !== null) {
        echo $wp_embed->run_shortcode($video_shortcode[0]);
    } else {
        if (has_post_thumbnail()) {
            get_template_part('partials/blog/posts/normal/featured-image');
        }
    }
}
?>
    </div>

    <?php 
get_template_part('partials/blog/posts/normal/post', 'header');
?>

    <div class="post-body">
        <?php 
echo apply_filters('the_content', $content);
if (!is_single() && oxy_get_option('blog_show_readmore') == 'on') {
    // show up to readmore tag and conditionally render the readmore
    oxy_read_more_link();
}
?>
    </div>

    <?php 
get_template_part('partials/blog/posts/normal/post', 'footer');
?>
</article>
开发者ID:rinodung,项目名称:live-theme,代码行数:31,代码来源:post-video.php


示例17: the_title

    ?>
        </h2>
    <?php 
} else {
    ?>
        <h1 class="post-title">
            <?php 
    the_title();
    ?>
        </h1>
    <?php 
}
?>

    <?php 
if (oxy_get_option('blog_post_header') === 'details') {
    ?>
        <?php 
    get_template_part('partials/blog/posts/normal/post', 'details');
    ?>
    <?php 
} else {
    ?>
        <?php 
    if (!empty($subtitle)) {
        ?>
            <p class="lead"><?php 
        echo $subtitle;
        ?>
</p>
        <?php 
开发者ID:ntngiri,项目名称:Wordpress-dhaba,代码行数:31,代码来源:post-header.php


示例18: get_header

<?php

/**
 * Displays the main body of the theme
 *
 * @package Omega
 * @subpackage Frontend
 * @since 0.1
 *
 * @copyright (c) 2014 Oxygenna.com
 * @license http://wiki.envato.com/support/legal-terms/licensing-terms/
 * @version 1.7.3
 */
get_header();
oxy_blog_header();
?>
<section class="section <?php 
echo oxy_get_option('blog_swatch');
?>
">
    <?php 
get_template_part('partials/blog/list', oxy_get_option('blog_style'));
?>
</section>
<?php 
get_footer();
开发者ID:rinodung,项目名称:wordpress-demo,代码行数:26,代码来源:single.php


示例19: remove_meta_box

{
    remove_meta_box('postimagediv', 'oxy_slideshow_image', 'side');
    add_meta_box('postimagediv', __('Slideshow Image', THEME_ADMIN_TD), 'post_thumbnail_meta_box', 'oxy_slideshow_image', 'advanced', 'low');
}
add_action('do_meta_boxes', 'oxy_move_slideshow_meta_box');
/**
 * Logo Custom Post
 */
$labels = array('name' => _x('Sections', THEME_ADMIN_TD), 'singular_name' => _x('Section', THEME_ADMIN_TD), 'add_new' => _x('Add New', THEME_ADMIN_TD), 'add_new_item' => __('Add New Section', THEME_ADMIN_TD), 'edit_item' => __('Edit Section', THEME_ADMIN_TD), 'new_item' => __('New Section', THEME_ADMIN_TD), 'view_item' => __('View Section', THEME_ADMIN_TD), 'search_items' => __('Search Sections', THEME_ADMIN_TD), 'not_found' => __('No sections found', THEME_ADMIN_TD), 'not_found_in_trash' => __('No sections found in Trash', THEME_ADMIN_TD), 'menu_name' => __('Sections', THEME_ADMIN_TD));
$args = array('labels' => $labels, 'public' => true, 'show_ui' => true, 'query_var' => false, 'rewrite' => false, 'supports' => array('title', 'editor', 'thumbnail'));
// create custom post
register_post_type('oxy_section', $args);
$labels = array('name' => __('Features', THEME_ADMIN_TD), 'singular_name' => __('Feature', THEME_ADMIN_TD), 'add_new' => __('Add New', THEME_ADMIN_TD), 'add_new_item' => __('Add New Feature', THEME_ADMIN_TD), 'edit_item' => __('Edit Feature', THEME_ADMIN_TD), 'new_item' => __('New Feature', THEME_ADMIN_TD), 'all_items' => __('All Features', THEME_ADMIN_TD), 'view_item' => __('View Feature', THEME_ADMIN_TD), 'search_items' => __('Search Features', THEME_ADMIN_TD), 'not_found' => __('No Features found', THEME_ADMIN_TD), 'not_found_in_trash' => __('No Features found in Trash', THEME_ADMIN_TD), 'menu_name' => __('Features', THEME_ADMIN_TD));
$args = array('labels' => $labels, 'public' => true, 'publicly_queryable' => true, 'show_ui' => true, 'show_in_menu' => true, 'query_var' => true, 'capability_type' => 'post', 'has_archive' => true, 'hierarchical' => false, 'menu_position' => null, 'supports' => array('title', 'editor'));
register_post_type('oxy_feature', $args);
/* ------------------ TESTIMONIALS -----------------------*/
$labels = array('name' => __('Testimonial', THEME_ADMIN_TD), 'singular_name' => __('Testimonial', THEME_ADMIN_TD), 'add_new' => __('Add New', THEME_ADMIN_TD), 'add_new_item' => __('Add New Testimonial', THEME_ADMIN_TD), 'edit_item' => __('Edit Testimonial', THEME_ADMIN_TD), 'new_item' => __('New Testimonial', THEME_ADMIN_TD), 'all_items' => __('All Testimonial', THEME_ADMIN_TD), 'view_item' => __('View Testimonial', THEME_ADMIN_TD), 'search_items' => __('Search Testimonial', THEME_ADMIN_TD), 'not_found' => __('No Testimonial found', THEME_ADMIN_TD), 'not_found_in_trash' => __('No Testimonial found in Trash', THEME_ADMIN_TD), 'menu_name' => __('Testimonials', THEME_ADMIN_TD));
$args = array('labels' => $labels, 'public' => true, 'publicly_queryable' => true, 'show_ui' => true, 'show_in_menu' => true, 'query_var' => true, 'capability_type' => 'post', 'has_archive' => true, 'hierarchical' => false, 'menu_position' => null, 'menu_icon' => ADMIN_ASSETS_URI . 'images/testimonials.png', 'supports' => array('title', 'editor', 'thumbnail', 'page-attributes'));
register_post_type('oxy_testimonial', $args);
$labels = array('name' => _x('Gallery Items', THEME_ADMIN_TD), 'singular_name' => _x('Gallery Item', THEME_ADMIN_TD), 'add_new' => _x('Add New', THEME_ADMIN_TD), 'add_new_item' => __('Add New Gallery Item', THEME_ADMIN_TD), 'edit_item' => __('Edit Gallery Item', THEME_ADMIN_TD), 'new_item' => __('New Gallery Item', THEME_ADMIN_TD), 'view_item' => __('View Gallery Item', THEME_ADMIN_TD), 'search_items' => __('Search Gallery Items', THEME_ADMIN_TD), 'not_found' => __('No Gallery Items found', THEME_ADMIN_TD), 'not_found_in_trash' => __('No Gallery Items found in Trash', THEME_ADMIN_TD), 'parent_item_colon' => '', 'menu_name' => __('Gallery Items', THEME_ADMIN_TD));
// fetch portfolio slug
$permalink_slug = trim(oxy_get_option('portfolio_slug'));
if (empty($permalink_slug)) {
    $permalink_slug = 'gallery';
}
$args = array('labels' => $labels, 'public' => true, 'publicly_queryable' => true, 'show_ui' => true, 'query_var' => true, 'capability_type' => 'post', 'hierarchical' => false, 'menu_position' => null, 'menu_icon' => ADMIN_ASSETS_URI . 'images/portfolio.png', 'supports' => array('title', 'editor', 'thumbnail', 'page-attributes', 'post-formats'), 'rewrite' => array('slug' => $permalink_slug, 'with_front' => true, 'pages' => true, 'feeds' => false));
// create custom post
register_post_type('oxy_gallery_item', $args);
// Register portfolio taxonomy
$labels = array('name' => __('Galleries', THEME_ADMIN_TD), 'singular_name' => __('Gallery', THEME_ADMIN_TD), 'search_items' => __('Search Galleries', THEME_ADMIN_TD), 'all_items' => __('All Galleries', THEME_ADMIN_TD), 'edit_item' => __('Edit Gallery', THEME_ADMIN_TD), 'update_item' => __('Update Gallery', THEME_ADMIN_TD), 'add_new_item' => __('Add New Gallery', THEME_ADMIN_TD), 'new_item_name' => __('New Gallery Name', THEME_ADMIN_TD));
register_taxonomy('oxy_gallery_categories', 'oxy_gallery_item', array('hierarchical' => true, 'labels' => $labels, 'show_ui' => true, 'query_var' => true));
开发者ID:vanie3,项目名称:appland,代码行数:31,代码来源:custom_posts.php


示例20: wp_get_post_terms

 * Shows related posts
 *
 * @package Lambda
 * @subpackage Frontend
 * @since 1.3
 *
 * @copyright (c) 2015 Oxygenna.com
 * @license **LICENSE**
 * @version 1.17.0
 */
// get related posts excluding this one.
$cats = wp_get_post_terms($post->ID, 'oxy_portfolio_categories');
$related_text = oxy_get_option('related_portfolio_text');
if (!empty($cats)) {
    $args = array('post_type' => 'oxy_portfolio_image', 'numberposts' => oxy_get_option('related_portfolio_count'), 'post__not_in' => array($post->ID), 'orderby' => 'rand', 'tax_query' => array(array('taxonomy' => 'oxy_portfolio_categories', 'field' => 'slug', 'terms' => $cats[0]->slug)));
    $columns = intval(oxy_get_option('related_portfolio_columns'));
    $span_width = $columns > 0 ? floor(12 / $columns) : 12;
    $posts = get_posts($args);
}
?>

<?php 
if ($posts) {
    ?>
    <section class="section portfolio-related">
        <div class="container">
            <div class="row element-bottom-80 text-center">
                <?php 
    if (!empty($related_text)) {
        ?>
                    <h3 class="element-top-30 element-bottom-30">
开发者ID:ntngiri,项目名称:Wordpress-dhaba,代码行数:31,代码来源:portfolio-related.php



注:本文中的oxy_get_option函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP p函数代码示例发布时间:2022-05-15
下一篇:
PHP oxRemClassModule函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap