当前位置: 首页>>代码示例>>PHP>>正文


PHP tfuse_sidebar_position函数代码示例

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


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

示例1: tfuse_class

 function tfuse_class($param, $return = false)
 {
     $tfuse_class = '';
     $sidebar_position = tfuse_sidebar_position();
     if ($param == 'middle') {
         if (is_page_template('template-contact.php')) {
             if ($sidebar_position == 'left') {
                 $tfuse_class = ' class="middle sidebarLeft nobg"';
             } elseif ($sidebar_position == 'right') {
                 $tfuse_class = ' class="middle sidebarRight nobg"';
             } else {
                 $tfuse_class = ' class="middle"';
             }
         } else {
             if ($sidebar_position == 'left') {
                 $tfuse_class = ' class="middle sidebarLeft"';
             } elseif ($sidebar_position == 'right') {
                 $tfuse_class = ' class="middle sidebarRight"';
             } else {
                 $tfuse_class = ' class="middle"';
             }
         }
     } elseif ($param == 'content') {
         $tfuse_class = isset($sidebar_position) && $sidebar_position != 'full' ? ' class="grid_8 content"' : ' class="content"';
     }
     if ($return) {
         return $tfuse_class;
     } else {
         echo $tfuse_class;
     }
 }
开发者ID:shimion,项目名称:stlucks,代码行数:31,代码来源:THEME_FUNCTIONS.php

示例2: get_header

<?php

get_header();
$sidebar_position = tfuse_sidebar_position();
tfuse_shortcode_content('top');
wp_register_script('isotope', tfuse_get_file_uri('/js/isotope.pkgd.min.js'), array('jquery'), '1.0', true);
wp_enqueue_script('isotope');
global $post;
$columns = tfuse_get_portfolio_columns();
$ID = tfuse_return_term_id();
?>
<div id="main" class="site-main blog" role="main">
    <?php 
tfuse_custom_cat_title($ID, 'events');
?>
    <div <?php 
tfuse_class('middle');
?>
 >
        <div class="row">
            <div class="col-sm-12">
                <section class="gallery">
                    <?php 
tfuse_show_gallery_filter();
?>
                    <ul id="gallery-list" class="gallery-list <?php 
echo $columns;
?>
">
                        <?php 
if (have_posts()) {
开发者ID:part-time-project,项目名称:italians,代码行数:31,代码来源:taxonomy-group.php

示例3: tf_reservationform_shortcode


//.........这里部分代码省略.........
        $input_array['date_in'] = $text_type;
        $input_array['date_out'] = $text_type;
        $input_array['res_email'] = $email_type;
        $linewidth = 0;
        $fcount = 1;
        $margin = 30;
        foreach ($form['input'] as $form_input) {
            $field = '';
            $input = array();
            if (isset($input_array[$form_input['type']])) {
                $input = $input_array[$form_input['type']];
            }
            if (isset($input['properties'])) {
                $proprstr = '';
                foreach ($input['properties'] as $key => $value) {
                    $proprstr .= $key . "=" . $value . " ";
                }
            }
            $floating = isset($form_input['newline']) ? 'clear:left;' : ' ';
            if (!isset($input['properties']['class'])) {
                $input['properties']['class'] = '';
            }
            $input['properties']['class'] .= isset($input['name']) && $input['name'] == 'Email' ? ' ' . TF_THEME_PREFIX . '_email' : '';
            $input['properties']['class'] .= isset($form_input['required']) ? ' tf_rf_required_input ' : '';
            $label_text = isset($form_input['required']) ? trim(urldecode($form_input['label'])) . ' ' . urldecode($form['required_text']) : trim(urldecode($form_input['label']));
            $input['id'] = isset($input['id']) ? str_replace('%%name%%', urldecode($form_input['shortcode']), $input['id']) : TF_THEME_PREFIX . '_' . urldecode($form_input['shortcode']);
            $form_input['classes'] = $earr[$fcount]['class'];
            $form_input['floating'] = $floating;
            $form_input['label_text'] = $label_text;
            $label = '<label for="' . TF_THEME_PREFIX . "_" . trim(urldecode($form_input['shortcode'])) . '">' . urldecode($label_text) . '</label><br/>';
            if ($is_preview) {
                $sidebar_position = 'full';
            } else {
                $sidebar_position = tfuse_sidebar_position();
            }
            $element_line = $earr[$fcount]['line'];
            if ($sidebar_position == 'full') {
                if ($is_preview) {
                    $ewidth = 640 - $lines[$element_line] + $margin;
                } else {
                    $ewidth = 942 - $lines[$element_line] + $margin;
                }
            } else {
                $ewidth = 584 - $lines[$element_line] + $margin;
            }
            if (isset($form_input['newline']) && $form_input['newline'] == 1) {
                $linewidth = $form_input['width'];
            } else {
                $linewidth += $form_input['width'];
            }
            if ($form_input['width'] == 100) {
                $form_input['ewidthpx'] = $ewidth;
                $linewidth = 0;
            } elseif ($linewidth > 100) {
                $form_input['ewidthpx'] = (int) ($ewidth * $form_input['width'] / 100);
                $linewidth = 0;
            } else {
                $form_input['ewidthpx'] = (int) ($ewidth * $form_input['width'] / 100);
            }
            if ($lines[$element_line] == $dimension && $form_input['width'] >= 40 && $form_input['width'] <= 90) {
                $form_input['ewidthpx'] = (int) (($ewidth - $dimension) * $form_input['width'] / 100);
            } elseif ($lines[$element_line] == $dimension && $form_input['width'] < 40 && $form_input['width'] > 32) {
                $form_input['ewidthpx'] = (int) (($ewidth - 2 * $dimension) * $form_input['width'] / 100);
            } elseif ($lines[$element_line] == $dimension && $form_input['width'] < 33) {
                $form_input['ewidthpx'] = (int) (($ewidth - 3 * $dimension) * $form_input['width'] / 100);
            }
开发者ID:shimion,项目名称:stlucks,代码行数:67,代码来源:reservationform.php

示例4: widget

    function widget($args, $instance)
    {
        extract($args);
        $title = apply_filters('widget_title', empty($instance['title']) ? __('Categories', 'tfuse') : $instance['title'], $instance, $this->id_base);
        $c = @$instance['count'] ? '1' : '0';
        $h = @$instance['hierarchical'] ? '1' : '0';
        $d = @$instance['dropdown'] ? '1' : '0';
        $e = !empty($instance['hide_empty']) ? '0' : '1';
        $p = empty($instance['parent']) ? '1' : '0';
        $sid_pos = tfuse_sidebar_position();
        $b = $instance['b'] = empty($instance['b']) ? '' : $instance['b'];
        $class = $b ? 'widget-boxed' : '';
        $before_widget = '<div class="widget widget_categories ' . $class . '">';
        $after_widget = '</div>';
        $before_title = '<h3 class="widget-title">';
        $after_title = '</h3>';
        echo $before_widget;
        $title = tfuse_qtranslate($title);
        if ($title) {
            echo $before_title . $title . $after_title;
        }
        if ($p) {
            $cat_ID = get_query_var('cat');
            $the_category = get_category($cat_ID);
            $parent_id = @$the_category->parent;
            if ($parent_id == 0) {
                $parent_id = $cat_ID;
            }
        } else {
            $parent_id = 0;
        }
        $cat_args = array('orderby' => 'parent,name', 'show_count' => $c, 'hierarchical' => $h, 'echo' => 0, 'hide_empty' => $e, 'child_of' => $parent_id);
        if ($d) {
            $cat_args['show_option_none'] = __('Select Category', 'tfuse');
            echo wp_dropdown_categories(apply_filters('widget_categories_dropdown_args', $cat_args));
            ?>
        <script type='text/javascript'>
            /* <![CDATA[ */
            var dropdown = document.getElementById("cat");
            function onCatChange() {
                if ( dropdown.options[dropdown.selectedIndex].value > 0 ) {
                    location.href = "<?php 
            echo home_url();
            ?>
/?cat="+dropdown.options[dropdown.selectedIndex].value;
                }
            }
            dropdown.onchange = onCatChange;
            /* ]]> */
        </script>

        <?php 
        } else {
            ?>
        <ul>
            <?php 
            $cat_args['title_li'] = '';
            $list_categories = wp_list_categories(apply_filters('widget_categories_args', $cat_args));
            $intPos = strripos($list_categories, '<a');
            $intPos = $intPos + 2;
            printf("%s class=\"last\" %s", substr($list_categories, 0, $intPos), substr($list_categories, $intPos, strlen($list_categories)));
            ?>
        </ul>
        <?php 
        }
        echo $after_widget;
    }
开发者ID:pinchpointer,项目名称:ppsitewordpress,代码行数:67,代码来源:TFuse_Widget_Categories.php

示例5: tf_contactform_shortcode


//.........这里部分代码省略.........
            } else {
                $earr[$fcount]['class'] = ' ';
                $earr[$fcount]['line'] = $linenr;
                $lines[$linenr] += $dimension;
            }
            if ($countForm == $fcount && !isset($form_input_arr['newline'])) {
                $earr[$fcount]['class'] = ' omega ';
            }
            $fcount++;
        }
        $linewidth = 0;
        $fcount = 1;
        $margin = 27;
        $out_left = '<div class="column-left">';
        $out_right = '<div class="column-right">';
        foreach ($colmuns as $form_input) {
            $field = '';
            $field_m = '';
            $input = $input_array[$form_input['type']];
            $floating = isset($form_input['newline']) ? 'clear:left;' : '';
            if (!isset($input['properties']['class'])) {
                $input['properties']['class'] = '';
            }
            $input['properties']['class'] .= $input['name'] == 'Email' ? ' ' . TF_THEME_PREFIX . '_email' : '';
            $input['properties']['class'] .= isset($form_input['required']) && $form_input['required'] ? ' tf_cf_required_input ' : '';
            $label_text = isset($form_input['required']) && $form_input['required'] ? trim($form_input['label']) . ' ' . $form['required_text'] : trim($form_input['label']);
            $input['id'] = str_replace('%%name%%', strtolower(str_ireplace(' ', '_', $form_input['shortcode'])), $input['id']);
            $form_input['classes'] = $earr[$fcount]['class'];
            $form_input['floating'] = $floating;
            $form_input['label_text'] = $label_text;
            if ($is_preview) {
                $sidebar_position = 'full';
            } else {
                $sidebar_position = tfuse_sidebar_position();
            }
            $element_line = $earr[$fcount]['line'];
            if ($sidebar_position == 'full' || is_page() && basename(get_page_template()) == 'template-page-full.php') {
                if ($is_preview) {
                    $ewidth = 275 - $lines[$element_line] + $margin;
                } else {
                    if ($form_input["column"] == 0) {
                        $ewidth = 355 - $lines[$element_line] + $margin;
                    } else {
                        $ewidth = 755 - $lines[$element_line] + $margin;
                    }
                }
            } else {
                if ($form_input["column"] == 0) {
                    $ewidth = 212 - $lines[$element_line] + $margin;
                } else {
                    $ewidth = 452 - $lines[$element_line] + $margin;
                }
            }
            if (isset($form_input['newline'])) {
                $linewidth = $form_input['width'];
            } else {
                $linewidth += $form_input['width'];
            }
            if ($form_input['width'] == 100) {
                $form_input['ewidthpx'] = $ewidth;
                $linewidth = 0;
            } elseif ($linewidth > 100) {
                $form_input['ewidthpx'] = (int) ($ewidth * $form_input['width'] / 100);
                $linewidth = 0;
            } else {
                $form_input['ewidthpx'] = (int) ($ewidth * $form_input['width'] / 100);
开发者ID:aaronfrey,项目名称:PepperLillie-GVCO,代码行数:67,代码来源:contactform.php

示例6: tf_contactform_shortcode


//.........这里部分代码省略.........
                $earr[$fcount]['class'] = ' omega ';
                $earr[$fcount]['line'] = $linenr;
                $lines[$linenr] += $dimension;
                $linenr++;
                $lines[$linenr] = 0;
            } else {
                $earr[$fcount]['class'] = ' ';
                $earr[$fcount]['line'] = $linenr;
                $lines[$linenr] += $dimension;
            }
            if ($countForm == $fcount && !isset($form_input_arr['newline'])) {
                $earr[$fcount]['class'] = ' omega ';
            }
            $fcount++;
        }
        $linewidth = 0;
        $fcount = 1;
        $margin = 40;
        foreach ($form['input'] as $form_input) {
            $field = '';
            $field_m = '';
            $input = $input_array[$form_input['type']];
            $floating = isset($form_input['newline']) ? 'clear:left;' : '';
            if (!isset($input['properties']['class'])) {
                $input['properties']['class'] = '';
            }
            $input['properties']['class'] .= $input['name'] == 'Email' ? ' ' . TF_THEME_PREFIX . '_email' : '';
            $input['properties']['class'] .= isset($form_input['required']) && $form_input['required'] ? ' tf_cf_required_input ' : '';
            $label_text = isset($form_input['required']) && $form_input['required'] ? trim($form_input['label']) . ' ' . $form['required_text'] : trim($form_input['label']);
            $input['id'] = str_replace('%%name%%', strtolower(str_ireplace(' ', '_', $form_input['shortcode'])), $input['id']);
            $form_input['classes'] = $earr[$fcount]['class'];
            $form_input['floating'] = $floating;
            $form_input['label_text'] = $label_text;
            if ($is_preview) {
                $sidebar_position = 'full';
            } else {
                $sidebar_position = tfuse_sidebar_position();
            }
            if (isset($form_input['newline'])) {
                $field_m .= '<div class="clear"></div>';
            }
            $element_line = $earr[$fcount]['line'];
            if ($sidebar_position == 'full') {
                if ($is_preview) {
                    $ewidth = 640 - $lines[$element_line] + $margin;
                } else {
                    $ewidth = 942 - $lines[$element_line] + $margin;
                }
            } else {
                $ewidth = 584 - $lines[$element_line] + $margin;
            }
            if (isset($form_input['newline'])) {
                $linewidth = $form_input['width'];
            } else {
                $linewidth += $form_input['width'];
            }
            if ($form_input['width'] == 100) {
                $form_input['ewidthpx'] = $ewidth;
                $linewidth = 0;
            } elseif ($linewidth > 100) {
                $form_input['ewidthpx'] = (int) ($ewidth * $form_input['width'] / 100);
                $linewidth = 0;
            } else {
                $form_input['ewidthpx'] = (int) ($ewidth * $form_input['width'] / 100);
            }
            if ($lines[$element_line] == $dimension && $form_input['width'] >= 40 && $form_input['width'] <= 90) {
                $form_input['ewidthpx'] = (int) (($ewidth - $dimension) * $form_input['width'] / 100);
            } elseif ($lines[$element_line] == $dimension && $form_input['width'] < 40 && $form_input['width'] > 32) {
                $form_input['ewidthpx'] = (int) (($ewidth - 2 * $dimension) * $form_input['width'] / 100);
            } elseif ($lines[$element_line] == $dimension && $form_input['width'] < 33) {
                $form_input['ewidthpx'] = (int) (($ewidth - 3 * $dimension) * $form_input['width'] / 100);
            }
            if ($is_preview && $input['type'] == 'select') {
                $form_input['ewidthpx'] -= 44;
            }
            $input_field = $input['type']($input, $form_input);
            if (stripos('[input]', $form['form_template']) !== false) {
            } else {
                $field_m .= $input_field;
            }
            if (trim($earr[$fcount]['class']) == 'omega') {
                $field_m .= '<div class="clear"></div>';
            }
            $field .= $field_m;
            $fields .= $field;
            $fcount++;
        }
        $out .= $fields;
        $surse = get_template_directory_uri() . '/images/ajax-loader.gif';
        $out .= '<div class="clear"></div><div class="row" style="width:100%">';
        $out .= '<span class="reset-link"><a href="#" onclick="resetFields(this,event)">' . urldecode($form['reset_button']) . '</a></span>';
        $out .= '<a href="#" id="sending" class="btn-send2"><span>' . __('Sending ...', 'tfuse') . '</span></a>
        <input type="submit" id="send_form" class="btn-submit" name="submit" title="Submit message" value="' . $form['submit_mess'] . '" />
        <img id="sending_img" src="' . $surse . '" alt="Sending" style="margin-left:-10px; margin-bottom:-6px; display: none; border:0;" /></div>
        </form></div>';
    } else {
        $out = "<p>This Form is not defined!!</p>";
    }
    return $out;
}
开发者ID:shimion,项目名称:stlucks,代码行数:101,代码来源:contactform.php

示例7: tfuse_class

 function tfuse_class($param, $return = false)
 {
     $tfuse_class = '';
     $sidebar_position = tfuse_sidebar_position();
     if ($param == 'middle') {
         if ($sidebar_position == 'left') {
             $tfuse_class = ' class="container sidebar-left"';
         } elseif ($sidebar_position == 'right') {
             $tfuse_class = ' class="container sidebar-right"';
         } else {
             $tfuse_class = ' class="container full-width"';
         }
     }
     if ($return) {
         return $tfuse_class;
     } else {
         echo $tfuse_class;
     }
 }
开发者ID:part-time-project,项目名称:italians,代码行数:19,代码来源:THEME_FUNCTIONS.php

示例8: tf_reservationform_shortcode


//.........这里部分代码省略.........
        $input_array['res_email'] = $email_type;
        $linewidth = 0;
        $fcount = 1;
        $margin = 27;
        $out_left = '<div class="column-left">';
        $out_right = '<div class="column-right">';
        foreach ($colmuns as $form_input) {
            $field = '';
            $input = array();
            if (isset($input_array[$form_input['type']])) {
                $input = $input_array[$form_input['type']];
            }
            if (isset($input['properties'])) {
                $proprstr = '';
                foreach ($input['properties'] as $key => $value) {
                    $proprstr .= $key . "=" . $value . " ";
                }
            }
            $floating = isset($form_input['newline']) ? 'clear:left;' : ' ';
            if (!isset($input['properties']['class'])) {
                $input['properties']['class'] = '';
            }
            $input['properties']['class'] .= isset($input['name']) && $input['name'] == 'Email' ? ' ' . TF_THEME_PREFIX . '_email' : '';
            $input['properties']['class'] .= isset($form_input['required']) ? ' tf_rf_required_input ' : '';
            $label_text = isset($form_input['required']) ? trim(urldecode($form_input['label'])) . ' ' . urldecode($form['required_text']) : trim(urldecode($form_input['label']));
            $input['id'] = isset($input['id']) ? str_replace('%%name%%', urldecode($form_input['shortcode']), $input['id']) : TF_THEME_PREFIX . '_' . urldecode($form_input['shortcode']);
            $form_input['classes'] = $earr[$fcount]['class'];
            $form_input['floating'] = $floating;
            $form_input['label_text'] = $label_text;
            $label = '<label for="' . TF_THEME_PREFIX . "_" . trim(urldecode($form_input['shortcode'])) . '">' . urldecode($label_text) . '</label><br/>';
            if ($is_preview) {
                $sidebar_position = 'full';
            } else {
                $sidebar_position = tfuse_sidebar_position();
            }
            $element_line = $earr[$fcount]['line'];
            if ($sidebar_position == 'full' || is_page() && basename(get_page_template()) == 'template-page-full.php') {
                if ($is_preview) {
                    $ewidth = 621 - $lines[$element_line] + $margin;
                } else {
                    if ($form_input["column"] == 0) {
                        $ewidth = 355 - $lines[$element_line] + $margin;
                    } else {
                        $ewidth = 755 - $lines[$element_line] + $margin;
                    }
                }
            } else {
                if ($form_input["column"] == 0) {
                    $ewidth = 212 - $lines[$element_line] + $margin;
                } else {
                    $ewidth = 452 - $lines[$element_line] + $margin;
                }
            }
            if (isset($form_input['newline']) && $form_input['newline'] == 1) {
                $linewidth = $form_input['width'];
            } else {
                $linewidth += $form_input['width'];
            }
            if ($form_input['width'] == 100) {
                $form_input['ewidthpx'] = $ewidth;
                $linewidth = 0;
            } elseif ($linewidth > 100) {
                $form_input['ewidthpx'] = (int) ($ewidth * $form_input['width'] / 100);
                $linewidth = 0;
            } else {
                $form_input['ewidthpx'] = (int) ($ewidth * $form_input['width'] / 100);
开发者ID:aaronfrey,项目名称:PepperLillie-GVCO,代码行数:67,代码来源:reservationform.php

示例9: tf_reservationform_shortcode


//.........这里部分代码省略.........
        $input_array['date_out'] = $text_type;
        $input_array['res_email'] = $email_type;
        $linewidth = 0;
        $fcount = 1;
        $margin = 25;
        $out_left = '<div class="col-lg-3 col-lg-offset-1 col-md-4 col-sm-7 col-xs-10 left-colum">';
        $out_right = '<div class="col-md-7 col-xs-12 right-colum">';
        foreach ($colmuns as $form_input) {
            $input = array();
            if (isset($input_array[$form_input['type']])) {
                $input = $input_array[$form_input['type']];
            }
            if (isset($input['properties'])) {
                $proprstr = '';
                foreach ($input['properties'] as $key => $value) {
                    $proprstr .= $key . "=" . $value . " ";
                }
            }
            $floating = isset($form_input['newline']) ? 'clear:left;' : ' ';
            if (!isset($input['properties']['class'])) {
                $input['properties']['class'] = '';
            }
            $input['properties']['class'] .= isset($input['name']) && $input['name'] == 'Email' ? ' ' . TF_THEME_PREFIX . '_email' : '';
            $input['properties']['class'] .= isset($form_input['required']) ? ' tf_rf_required_input ' : '';
            $label_text = isset($form_input['required']) ? trim(urldecode($form_input['label'])) . ' ' . urldecode($form['required_text']) : trim(urldecode($form_input['label']));
            $input['id'] = isset($input['id']) ? str_replace('%%name%%', urldecode($form_input['shortcode']), $input['id']) : TF_THEME_PREFIX . '_' . urldecode($form_input['shortcode']);
            $form_input['classes'] = $earr[$fcount]['class'];
            $form_input['floating'] = $floating;
            $form_input['label_text'] = $label_text;
            $label = '<label for="' . TF_THEME_PREFIX . "_" . trim(urldecode($form_input['shortcode'])) . '">' . urldecode($label_text) . '</label><br/>';
            if ($is_preview) {
                $sidebar_position = 'full';
            } else {
                $sidebar_position = tfuse_sidebar_position();
            }
            $element_line = $earr[$fcount]['line'];
            if ($sidebar_position == 'full' || $form['position'] == 'before_content') {
                if ($is_preview) {
                    $ewidth = 590 - $lines[$element_line] + $margin;
                } else {
                    if (isset($form_input["column"]) && $form_input["column"] == '0') {
                        // special for left column
                        $margin_leftc = 12;
                        $line_left = $lines[$element_line] / 25 * $margin_leftc;
                        $ewidth = 216 - $line_left + $margin_leftc;
                    } else {
                        $ewidth = 616 - $lines[$element_line] + $margin;
                    }
                }
            } else {
                if (isset($form_input["column"]) && $form_input["column"] == '0') {
                    // special for left column
                    $margin_leftc = 12;
                    $line_left = $lines[$element_line] / 25 * $margin_leftc;
                    $ewidth = 144 - $line_left + $margin_leftc;
                } else {
                    $ewidth = 380 - $lines[$element_line] + $margin;
                }
            }
            if (isset($form_input['newline']) && $form_input['newline'] == 1) {
                $linewidth = $form_input['width'];
            } else {
                $linewidth += $form_input['width'];
            }
            if ($form_input['width'] == 100) {
                $form_input['ewidthpx'] = $ewidth;
开发者ID:part-time-project,项目名称:italians,代码行数:67,代码来源:reservationform.php


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