本文整理汇总了PHP中wpex_get_post_layout_class函数的典型用法代码示例。如果您正苦于以下问题:PHP wpex_get_post_layout_class函数的具体用法?PHP wpex_get_post_layout_class怎么用?PHP wpex_get_post_layout_class使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了wpex_get_post_layout_class函数的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: wpex_password_form
function wpex_password_form()
{
global $post;
$label = 'pwbox-' . (empty($post->ID) ? rand() : $post->ID);
$classes = 'password-protection-box clr';
if ('full-screen' == wpex_get_post_layout_class()) {
$classes .= ' container';
}
$output = '<div class="' . $classes . '"><form action="' . esc_url(site_url('wp-login.php?action=postpass', 'login_post')) . '" method="post">
<h2>' . __('Password Protected', 'wpex') . '</h2>
<p>' . __('This content is password protected. To view it please enter your password below:', 'wpex') . '</p>
<input name="post_password" id="' . $label . '" type="password" size="20" maxlength="20" placeholder="' . __('Password', 'wpex') . '" /><input type="submit" name="Submit" value="' . esc_attr__('Submit', 'wpex') . '" />
</form></div>';
return $output;
}
示例2: get_header
*
* @package Total
* @subpackage Templates
* @author Alexander Clarke
* @copyright Copyright (c) 2014, Symple Workz LLC
* @link http://www.wpexplorer.com
* @since Total 1.0.0
*/
get_header();
?>
<?php
while (have_posts()) {
the_post();
?>
<div id="content-wrap" class="container clr <?php
echo wpex_get_post_layout_class();
?>
">
<section id="primary" class="content-area clr">
<div id="content" class="site-content clr" role="main">
<?php
// Display portfolio single media if enabled in the admin
get_template_part('partials/portfolio/portfolio-single', 'media');
?>
<article class="entry clr">
<?php
the_content();
?>
</article><!-- .entry clr -->
<?php
// Social Sharing links
示例3: wpex_body_classes
function wpex_body_classes($classes)
{
// Get post ID
$post_id = wpex_get_the_id();
// Define main layout style
$main_layout = wpex_main_layout($post_id);
// WPExplorer class
$classes[] = 'wpex-theme';
// Responsive
if (get_theme_mod('responsive', 'on')) {
$classes[] = 'wpex-responsive';
}
// Add skin to body classes
if (function_exists('wpex_active_skin') && wpex_active_skin()) {
$classes[] = 'theme-' . wpex_active_skin();
}
// Check if the Visual Composer is being used on this page
if (function_exists('wpex_post_has_composer') && wpex_post_has_composer($post_id)) {
$classes[] = 'has-composer';
}
// Meta Options
if ($post_id) {
// No header margin
if ('on' == get_post_meta($post_id, 'wpex_disable_header_margin', true)) {
$classes[] = 'no-header-margin';
}
// Slider
if (wpex_post_slider_shortcode($post_id)) {
$classes[] = 'page-with-slider';
}
// Title with Background Image
if ('background-image' == get_post_meta($post_id, 'wpex_post_title_style', true)) {
$classes[] = 'page-with-background-title';
}
}
// Layout Style
$classes[] = $main_layout . '-main-layout';
// Boxed Layout dropshadow
if ('boxed' == $main_layout && get_theme_mod('boxed_dropdshadow')) {
$classes[] = 'wrap-boxshadow';
}
// Content layout
if (function_exists('wpex_get_post_layout_class')) {
$classes[] = 'content-' . wpex_get_post_layout_class($post_id);
}
// Single Post cagegories
if (is_singular('post')) {
$cats = get_the_category($post_id);
foreach ($cats as $cat) {
$classes[] = 'post-in-category-' . $cat->category_nicename;
}
}
// Breadcrumbs
if (function_exists('wpex_breadcrumbs_enabled') && wpex_breadcrumbs_enabled() && 'default' == get_theme_mod('breadcrumbs_position', 'default')) {
$classes[] = 'has-breadcrumbs';
}
// Shrink fixed header
if (get_theme_mod('shink_fixed_header', '1') && 'one' == get_theme_mod('header_style', 'one')) {
$classes[] = 'shrink-fixed-header';
}
// WooCommerce
if (class_exists('Woocommerce') && is_shop()) {
if (get_theme_mod('woo_shop_slider')) {
$classes[] = 'page-with-slider';
}
if (!get_theme_mod('woo_shop_title', '1')) {
$classes[] = 'page-without-title';
}
}
// Widget Icons
if (get_theme_mod('widget_icons', 'on')) {
$classes[] = 'sidebar-widget-icons';
}
// Mobile
if (wp_is_mobile()) {
$classes[] = 'is-mobile';
}
// Overlay header style
if (function_exists('wpex_is_overlay_header_enabled') && wpex_is_overlay_header_enabled($post_id)) {
$classes[] = 'has-overlay-header';
}
// Footer reveal
if (function_exists('wpex_footer_reveal_enabled') && wpex_footer_reveal_enabled($post_id)) {
$classes[] = 'footer-has-reveal';
}
return $classes;
}
示例4: comments_template
<?php
// Get comments & comment form if enabled for portfoliop posts
if (wpex_option('portfolio_comments') == '1') {
?>
<section id="portfolio-post-comments" class="clr">
<?php
comments_template();
?>
</section><!-- #portfolio-post-comments -->
<?php
}
?>
<?php
// Display Related or other Portfolio Items
if (wpex_option('portfolio_related', '1') == '1' && wpex_get_post_layout_class() !== 'full-screen' && !post_password_required()) {
// Create an array of current category ID's
$wpex_related_cats = wp_get_post_terms(get_the_ID(), 'portfolio_category');
$wpex_related_cats_ids = array();
foreach ($wpex_related_cats as $wpex_related_cat) {
$wpex_related_cats_ids[] = $wpex_related_cat->term_id;
}
// Related query arguments
$args = array('post_type' => 'portfolio', 'posts_per_page' => wpex_option('portfolio_related_count', '4'), 'orderby' => 'rand', 'post__not_in' => array(get_the_ID()), 'no_found_rows' => true, 'tax_query' => array(array('taxonomy' => 'portfolio_category', 'field' => 'id', 'terms' => $wpex_related_cats_ids, 'operator' => 'IN')));
$wpex_related_query = new wp_query($args);
// If posts were found display related items
if ($wpex_related_query->have_posts()) {
?>
<section class="related-portfolio-posts clr">
<div class="theme-heading"><span><?php
echo wpex_option('portfolio_related_title', __('Related Projects', 'wpex'));
示例5: get_theme_mod
* @version 1.0.0
*/
// Exit if accessed directly
if (!defined('ABSPATH')) {
exit;
}
// Return if disabled
if (!get_theme_mod('portfolio_related', true)) {
return;
}
// Vars
global $post;
$post_id = $post->ID;
$post_count = get_theme_mod('portfolio_related_count', '4');
// Return if full-screen post
if ('full-screen' == wpex_get_post_layout_class($post_id)) {
return;
}
// Return if pass required
if (post_password_required($post_id)) {
return;
}
// Disabled via meta setting - goodbye
if ('on' == get_post_meta($post_id, 'wpex_disable_related_items', true)) {
return;
}
// Create an array of current category ID's
$cats = wp_get_post_terms($post_id, 'portfolio_category');
$cats_ids = array();
foreach ($cats as $wpex_related_cat) {
$cats_ids[] = $wpex_related_cat->term_id;
示例6: wpex_get_the_ID
$el_class = $this->getExtraClass($el_class);
// Column sizes
if ($column_spacing) {
$el_class .= ' column-padding-' . $column_spacing;
}
// No margins class
if ('true' == $no_margins) {
$el_class .= ' no-margins';
}
// ID
if ($id) {
$id = 'id="' . $id . '"';
}
// Prevent center rown when not full-screen
$wpex_post_id = wpex_get_the_ID();
if ($wpex_post_id && 'full-screen' != wpex_get_post_layout_class($wpex_post_id)) {
$center_row = false;
}
// Animation
$css_animation_class = $css_animation !== '' ? 'wpb_animate_when_almost_visible wpb_' . $css_animation . '' : '';
// Is parallax allowed?
$parallax_class = '';
if (wpex_is_front_end_composer()) {
$parallax_allowed = false;
} else {
$parallax_allowed = true;
if ($bg_image) {
if ('parallax-advanced' == $bg_style || 'parallax' == $bg_style) {
$parallax_class = 'row-with-parallax';
}
}
示例7: wpex_get_post_layout_class
<?php
/**
* The Template for displaying standard post type content
*
* @package Total
* @subpackage Templates
* @author Alexander Clarke
* @copyright Copyright (c) 2014, Symple Workz LLC
* @link http://www.wpexplorer.com
* @since Total 1.4.0
*/
?>
<div id="content-wrap" class="container clr <?php
echo wpex_get_post_layout_class(get_the_ID());
?>
">
<?php
// Display the post media above the post (this is a meta option)
if ('above' == get_post_meta(get_the_ID(), 'wpex_post_media_position', true) && !post_password_required()) {
$post_format = get_post_format() ? get_post_format() : 'thumbnail';
get_template_part('partials/blog/media/blog-single', $post_format);
}
?>
<section id="primary" class="content-area clr">
<div id="content" class="site-content clr" role="main">
<article class="single-blog-article clr">
<?php
// Get the single blog post layout template part
get_template_part('partials/blog/blog', 'single-layout');
示例8:
/**
* Main sidebar area containing your defined widgets
*
* @package Total
* @subpackage Templates
* @author Alexander Clarke
* @copyright Copyright (c) 2014, Symple Workz LLC
* @link http://www.wpexplorer.com
* @since Total 1.0.0
*/
?>
<?php
// Don't display sidebar for full-screen and full-width layouts
if ('full-screen' == wpex_get_post_layout_class() || 'full-width' == wpex_get_post_layout_class()) {
?>
<?php
return;
}
?>
<?php
wpex_hook_sidebar_before();
?>
<aside id="sidebar" class="sidebar-container sidebar-primary" role="complementary">
<?php
wpex_hook_sidebar_top();
?>
<div id="sidebar-inner" class="clr">
<?php
示例9: wpex_social_share
function wpex_social_share($post_id = NULL)
{
// Get sharing sites
$defaults = array('twitter', 'facebook', 'google_plus', 'pinterest', 'linkedin');
$sharing_sites = get_theme_mod('social_share_sites', $defaults);
// Return nothing if there aren't any sites enabled
if (empty($sharing_sites)) {
return;
}
// Get post id
$post_id = $post_id ? $post_id : wpex_get_the_id();
// Don't show social sharing on password protected posts
if (post_password_required($post_id)) {
return;
}
// Check if disabled in page settings
if ('on' == get_post_meta($post_id, 'wpex_disable_social', true)) {
return;
}
// Get sharing options
$position = get_theme_mod('social_share_position', 'horizontal');
$style = get_theme_mod('social_share_style', 'minimal');
// Output var
$output = '';
// Get and encode permalink
$permalink = get_permalink($post_id);
$url = urlencode($permalink);
// Get and encode title
$args = array('before' => false, 'after' => false, 'echo' => false, 'post' => $post_id);
$title = urlencode(esc_attr(the_title_attribute($args)));
// Get and encode summar
$args = array('length' => '40', 'echo' => false);
$summary = urlencode(wpex_excerpt($args));
// Get image
$img = wp_get_attachment_url(get_post_thumbnail_id($post_id));
// Source URL
$source = home_url();
// Sharing block heading
$heading = wpex_option('social_share_heading', __('Please Share This', 'wpex'));
$heading = apply_filters('wpex_social_share_heading', $heading);
// Get post layout
$post_layout = wpex_get_post_layout_class($post_id);
// Only display horizontal style menu for mobile devices
if (wp_is_mobile()) {
$position = 'horizontal';
}
// Tooltip Style
if (is_rtl()) {
$tooltip_class = 'tooltip-right';
} elseif ($position == 'horizontal') {
$tooltip_class = 'tooltip-up';
} else {
if ($post_layout == 'left-sidebar') {
$tooltip_class = 'tooltip-left';
} else {
$tooltip_class = 'tooltip-right';
}
}
// Display heading on Boxed layout
if ($position == 'horizontal') {
?>
<div class="social-share-title theme-heading"><span><?php
echo $heading;
?>
</span></div>
<?php
}
?>
<ul class="social-share-buttons position-<?php
echo $position;
?>
style-<?php
echo $style;
?>
clr">
<?php
// Loop through each social sharing site that is enabled
foreach ($sharing_sites as $site) {
// Twitter
if ('twitter' == $site) {
?>
<li class="share-twitter">
<a href="http://twitter.com/share?text=<?php
echo $title;
?>
&url=<?php
echo $url;
?>
" target="_blank" title="<?php
_e('Share on Twitter', 'wpex');
?>
" rel="nofollow" class="<?php
echo $tooltip_class;
?>
" onclick="javascript:window.open(this.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');return false;">
<span class="fa fa-twitter"></span>
<?php
if ($position == 'horizontal') {
?>
//.........这里部分代码省略.........
示例10: wpex_get_post_layout_class
<?php
/**
* Main sidebar area containing your defined widgets
*
* @package WordPress
* @subpackage Total
* @since Total 1.0
*/
// Don't display sidebar for full-screen and full-width layouts
$wpex_post_layout = wpex_get_post_layout_class();
if ($wpex_post_layout == 'full-screen' || $wpex_post_layout == 'full-width') {
return;
}
?>
<aside id="sidebar" class="sidebar-container sidebar-primary" role="complementary">
<?php
// Display the correct sidebar area
// See functions/get-sidebar.php
$wpex_get_sidebar = wpex_get_sidebar();
dynamic_sidebar($wpex_get_sidebar);
?>
</aside><!-- #sidebar -->
示例11: wpex_social_share
function wpex_social_share($postid = false)
{
// Bail
$site_layout = wpex_option('main_layout_style', 'full-width');
if ($site_layout == 'boxed' && !is_singular()) {
return;
}
if (post_password_required()) {
return;
}
// Get sharing options
$sharing_sites = wpex_option('social_share_sites');
if (empty($sharing_sites)) {
return;
}
// Get post
global $post;
$postid = $postid ? $postid : $post->ID;
if (!$postid) {
return;
}
$post_type = get_post_type($post);
$meta = get_post_meta($postid, 'wpex_disable_social', true);
// If disabled show nothing
if ($meta == 'true') {
return;
}
if (!is_singular('post') && ($post_type = 'post' && wpex_option('social_share_blog_entries', '1') !== '1')) {
return;
}
if (is_singular('post') && wpex_option('social_share_blog_posts', '1') !== '1') {
return;
}
if (is_singular('page') && wpex_option('social_share_pages', '1') !== '1') {
return;
}
if (is_singular('portfolio') && wpex_option('social_share_portfolio', '1') !== '1') {
return;
}
if (class_exists('Woocommerce')) {
if (is_singular('product') && is_woocommerce() && wpex_option('social_share_woo') !== '1') {
return;
}
if (!is_singular('product') && is_woocommerce()) {
return;
}
if (is_cart() || is_checkout()) {
return;
}
}
// Vars
$url = get_permalink($postid);
$url = urlencode($url);
$title = esc_attr(the_title_attribute('echo=0'));
$summary = wpex_get_excerpt('40');
$img = wp_get_attachment_url(get_post_thumbnail_id($postid));
$source = home_url();
$social_share_title = __('Please Share This', 'wpex');
$social_share_title = apply_filters('wpex_social_share_title', $social_share_title);
$wpex_post_layout = wpex_get_post_layout_class();
$output = '';
// Tooltip Style
if (is_rtl()) {
$tooltip_class = 'tooltip-right';
} elseif ($site_layout == 'boxed') {
$tooltip_class = 'tooltip-up';
} else {
if ($wpex_post_layout == 'left-sidebar') {
$tooltip_class = 'tooltip-left';
} else {
$tooltip_class = 'tooltip-right';
}
}
// Display heading on Boxed layout
if (is_singular()) {
$output .= '<div class="social-share-title theme-heading"><span>' . $social_share_title . '</span></div>';
}
// Open URL
$output .= '<ul class="social-share-buttons clr">';
// Loop through them
foreach ($sharing_sites as $key => $value) {
// Twitter
if ($key == 'twitter' && $value) {
$output .= '<li class="share-twitter"><a href="http://twitter.com/share?text=' . $title . '&url=' . $url . '" target="_blank" title="' . __('Share on Twitter', 'wpex') . '" rel="nofollow" class="' . $tooltip_class . '"><span class="fa fa-twitter"></span></a></li>';
}
// Facebook
if ($key == 'facebook' && $value) {
$output .= '<li class="share-facebook"><a href="http://www.facebook.com/sharer.php?s=100&p[url]=' . $url . '&p[images][0]=' . $img . '&p[title]=' . $title . '&p[summary]=' . $summary . '" target="_blank" title="' . __('Share on Facebook', 'wpex') . '" rel="nofollow" class="' . $tooltip_class . '"><span class="fa fa-facebook"></span></a></li>';
}
// Google+
if ($key == 'google_plus' && $value) {
$output .= '<li class="share-googleplus"><a title="' . __('Share on Google+', 'wpex') . '" rel="external" href="https://plusone.google.com/_/+1/confirm?url=' . $url . '" target="_blank" rel="nofollow" class="' . $tooltip_class . '"><span class="fa fa-google-plus"></span></a></li>';
}
// Pinterest
if ($key == 'pinterest' && $value) {
$output .= '<li class="share-pinterest"><a href="http://pinterest.com/pin/create/button/?url=' . $url . '&media=' . $img . '&description=' . $summary . '" target="_blank" title="' . __('Share on Pinterest', 'wpex') . '" rel="nofollow" class="' . $tooltip_class . '"><span class="fa fa-pinterest"></span></a></li>';
}
// LinkedIn
if ($key == 'linkedin' && $value) {
$output .= '<li class="share-linkedin"><a title="' . __('Share on LinkedIn', 'wpex') . '" rel="external" href="http://www.linkedin.com/shareArticle?mini=true&url=' . $url . '&title=' . $title . '&summary=' . $summary . '&source=' . $source . '" target="_blank" rel="nofollow" class="' . $tooltip_class . '"><span class="fa fa-linkedin"></span></a></li>';
//.........这里部分代码省略.........