// Exit if accessed directly
if (!defined('ABSPATH')) {
    exit;
}
// Get the title
$title = wpex_title();
// Return if there isn't a title
if (!$title) {
    return;
}
// Alter the heading for single blog posts and product posts to a span
if (is_singular('post') && 'custom_text' == wpex_get_mod('blog_single_header', 'custom_text') || is_singular('product')) {
    $tag = 'span';
    $schema_markup = null;
} else {
    $tag = 'h1';
    $schema_markup = wpex_get_schema_markup('headline');
}
// Remove schema for other post types
if (!in_array(get_post_type(), wpex_theme_post_types())) {
    $schema_markup = null;
}
$additionalClasses = '';
$portCat = get_the_terms(get_the_ID(), 'portfolio_category');
//echo print_r($portCat);
//echo $portCat[0]->name;
if (!empty($portCat)) {
    $additionalClasses = $portCat[0]->slug;
}
// Display title
echo '<' . $tag . ' class="page-header-title ' . $additionalClasses . '"' . $schema_markup . '>' . $title . '</' . $tag . '>';
Example #2
0
        /**
         * Settings page output
         *
         * @since 3.0.0
         *
         */
        public function create_admin_page()
        {
            ?>

			<div class="wrap">

				<h2><?php 
            esc_html_e('Customizer Manager', 'total');
            ?>
</h2>

				<?php 
            // Customizer url
            $customize_url = add_query_arg(array('return' => urlencode(wp_unslash($_SERVER['REQUEST_URI'])), 'wpex_theme_customizer' => 'true'), 'customize.php');
            ?>

				<h2 class="nav-tab-wrapper">
					<a href="#" class="nav-tab nav-tab-active"><?php 
            esc_html_e('Enable Panels', 'total');
            ?>
</a>
					<a href="<?php 
            echo esc_url($customize_url);
            ?>
"  class="nav-tab"><?php 
            esc_html_e('Customizer', 'total');
            ?>
<span class="dashicons dashicons-external" style="padding-left:7px;"></span></a>
				</h2>

				<div style="margin-top:20px;">
					<a href="#" class="wpex-customizer-check-all"><?php 
            esc_html_e('Check all', 'total');
            ?>
</a> | <a href="#" class="wpex-customizer-uncheck-all"><?php 
            esc_html_e('Uncheck all', 'total');
            ?>
</a>
				</div>

				<form method="post" action="options.php">

					<?php 
            settings_fields('wpex_customizer_editor');
            ?>

					<table class="form-table wpex-customizer-editor-table">
						<?php 
            // Get panels
            $panels = $this->panels;
            // Check if post types are enabled
            $post_types = wpex_theme_post_types();
            // Get options and set defaults
            $options = get_option('wpex_customizer_panels', $this->panels);
            // Loop through panels and add checkbox
            foreach ($panels as $id => $val) {
                // Parse panel data
                $title = isset($val['title']) ? $val['title'] : $val;
                $condition = isset($val['condition']) ? $val['condition'] : true;
                // Get option
                $option = isset($options[$id]) ? 'on' : false;
                // Display option if condition is met
                if ($condition) {
                    ?>

								<tr valign="top">
									<th scope="row"><?php 
                    echo $title;
                    ?>
</th>
									<td>
										<fieldset>
											<input class="wpex-customizer-editor-checkbox" type="checkbox" name="wpex_customizer_panels[<?php 
                    echo $id;
                    ?>
]"<?php 
                    checked($option, 'on');
                    ?>
>
										</fieldset>
									</td>
								</tr>

							<?php 
                } else {
                    ?>

								<input type="hidden" name="wpex_customizer_panels[<?php 
                    echo $id;
                    ?>
]"<?php 
                    checked($option, 'on');
                    ?>
>	

							<?php 
                }
                ?>

						<?php 
            }
            ?>

					</table>

					<?php 
            submit_button();
            ?>

				</form>

			</div><!-- .wrap -->

			<script>
				(function($) {
					"use strict";
						$( '.wpex-customizer-check-all' ).click( function() {
							$('.wpex-customizer-editor-checkbox').each( function() {
								this.checked = true;
							} );
							return false;
						} );
						$( '.wpex-customizer-uncheck-all' ).click( function() {
							$('.wpex-customizer-editor-checkbox').each( function() {
								this.checked = false;
							} );
							return false;
						} );
				} ) ( jQuery );
			</script>

		<?php 
        }
Example #3
0
        /**
         * Settings page output
         */
        public function create_admin_page()
        {
            ?>

			<div class="wrap">
				<h2><?php 
            _e('Customizer', 'wpex');
            ?>
</h2>
				<p>
					* <?php 
            _e('The customizer is where you will find all your theme options', 'wpex');
            ?>
					<br />
					* <?php 
            _e('Disabling sections will help speed up the WordPress customizer.', 'wpex');
            ?>
					<br />
					* <?php 
            _e('Disabling a section will NOT remove your options, it will simply hide the section from the customizer to speed things up.', 'wpex');
            ?>
				</p>
				<br />
				<h2 class="nav-tab-wrapper">
					<a href="#" class="nav-tab nav-tab-active"><?php 
            _e('Enable Panels', 'wpex');
            ?>
</a>
					<a href="<?php 
            echo admin_url('customize.php');
            ?>
"  class="nav-tab" target="_blank" ><?php 
            _e('Customize', 'wpex');
            ?>
</a>
				</h2>
				<div style="margin-top:20px;">
					<a href="#" class="wpex-customizer-check-all"><?php 
            _e('Check all', 'wpex');
            ?>
</a> | <a href="#" class="wpex-customizer-uncheck-all"><?php 
            _e('Uncheck all', 'wpex');
            ?>
</a>
				</div>
				<form method="post" action="options.php">
					<?php 
            settings_fields('wpex_customizer_editor');
            ?>
					<table class="form-table wpex-customizer-editor-table">
						<?php 
            // Get panels
            $panels = $this->panels;
            // Set defaults
            $defaults = array();
            foreach ($this->panels as $key => $val) {
                if (!in_array($key, $this->exclude_panels_from_defaults)) {
                    $defaults[$key] = 'on';
                }
            }
            // Check if post types are enabled
            $post_types = wpex_theme_post_types();
            // Get options and set defaults
            $options = get_option('wpex_customizer_panels', $defaults);
            // Loop through panels and add checkbox
            foreach ($panels as $id => $title) {
                // Hide any post type that is disabled
                if (in_array($id, $post_types) && !get_theme_mod($id . '_enable', true)) {
                    continue;
                }
                // Get option
                $option = isset($options[$id]) ? 'on' : false;
                ?>
							<tr valign="top">
							<th scope="row"><?php 
                echo $title;
                ?>
</th>
							<td>
								<fieldset>
									<input class="wpex-customizer-editor-checkbox" type="checkbox" name="wpex_customizer_panels[<?php 
                echo $id;
                ?>
]"<?php 
                checked($option, 'on');
                ?>
>
									<?php 
                if ('styling' == $id) {
                    echo '<span class="description">' . __('Styling options area added throughout for changing colors, paddings, borders, etc.', 'wpex') . '</span>';
                }
                ?>
								</fieldset>
							</td>
							</tr>
						<?php 
            }
            ?>
					</table>
					<?php 
            submit_button();
            ?>
				</form>
			</div><!-- .wrap -->
			<script>
				(function($) {
					"use strict";
						$( '.wpex-customizer-check-all' ).click( function() {
							$('.wpex-customizer-editor-checkbox').each( function() {
								this.checked = true;
							} );
							return false;
						} );
						$( '.wpex-customizer-uncheck-all' ).click( function() {
							$('.wpex-customizer-editor-checkbox').each( function() {
								this.checked = false;
							} );
							return false;
						} );
				} ) ( jQuery );
			</script>

		<?php 
        }
Example #4
0
        /**
         * Settings page output
         */
        function create_admin_page()
        {
            ?>
			<div class="wrap">
				<h2><?php 
            _e('Theme Panel', 'wpex');
            ?>
</h2>
				<form method="post" action="options.php">
					<?php 
            settings_fields('wpex_tweaks');
            ?>
					<table class="form-table">
						<tr valign="top">
							<th scope="row"><?php 
            _e('Enable Addons', 'wpex');
            ?>
</th>
							<td>
								<fieldset>
									<label><input type="checkbox" name="wpex_tweaks[favicons_enable]" <?php 
            checked(get_theme_mod('favicons_enable', true));
            ?>
> <?php 
            _e('Favicons', 'wpex');
            ?>
</label>
									<br />
									<label><input type="checkbox" name="wpex_tweaks[custom_404_enable]" <?php 
            checked(get_theme_mod('custom_404_enable', true));
            ?>
> <?php 
            _e('404 Page', 'wpex');
            ?>
</label>
									<br />
									<label><input type="checkbox" name="wpex_tweaks[custom_admin_login_enable]" <?php 
            checked(get_theme_mod('custom_admin_login_enable', true));
            ?>
> <?php 
            _e('Login Page', 'wpex');
            ?>
</label>
									<br />
									<label><input type="checkbox" name="wpex_tweaks[custom_css_enable]" <?php 
            checked(get_theme_mod('custom_css_enable', true));
            ?>
> <?php 
            _e('Custom CSS', 'wpex');
            ?>
</label>
									<br />
									<label><input type="checkbox" name="wpex_tweaks[widget_areas_enable]" <?php 
            checked(get_theme_mod('widget_areas_enable', true));
            ?>
> <?php 
            _e('Widget Areas', 'wpex');
            ?>
</label>
									<br />
									<label><input type="checkbox" name="wpex_tweaks[skins_enable]" <?php 
            checked(get_theme_mod('skins_enable', true));
            ?>
> <?php 
            _e('Skins', 'wpex');
            ?>
</label>
								</fieldset>
							</td>
						</tr>
						<tr valign="top">
							<th scope="row"><?php 
            _e('Minify Javascript', 'wpex');
            ?>
</th>
							<td>
								<fieldset>
									<label><input type="checkbox" name="wpex_tweaks[minify_js]"<?php 
            checked(get_theme_mod('minify_js', true));
            ?>
> <?php 
            _e('Minify and load all theme related javascript in one single, minified file.', 'wpex');
            ?>
</label>
									<p class="description"><?php 
            _e('Improves site speed but best to disable whenever you are troubleshooting an error.', 'wpex');
            ?>
</p>
								</fieldset>
							</td>
						</tr>
						<tr valign="top">
							<th scope="row"><?php 
            _e('Remove Script File Versions', 'wpex');
            ?>
</th>
							<td>
								<fieldset>
									<label><input type="checkbox" name="wpex_tweaks[remove_scripts_version]" <?php 
            checked(get_theme_mod('remove_scripts_version', true));
            ?>
> <?php 
            _e('Check to remove the scripts version numbers.', 'wpex');
            ?>
</label>
									<p class="description"><?php 
            _e('Most scripts and style-sheets called by WordPress include a query string identifying the version. This can cause issues with caching. You can toggle this setting on to remove the query string from such strings.', 'wpex');
            ?>
</p>
								</fieldset>
							</td>
						</tr>
						<tr valign="top">
							<th scope="row"><?php 
            _e('Cleanup WP Head', 'wpex');
            ?>
</th>
							<td>
								<fieldset>
									<label><input type="checkbox" name="wpex_tweaks[cleanup_head]" <?php 
            checked(get_theme_mod('cleanup_head', true));
            ?>
> <?php 
            _e('Remove code from the wp_head hook to clean things up.', 'wpex');
            ?>
</label>
									<p class="description"><?php 
            _e('Advanced option, use if you know what you are doing.', 'wpex');
            ?>
</p>
								</fieldset>
							</td>
						</tr>
						<tr valign="top">
							<th scope="row"><?php 
            _e('Image Resizing', 'wpex');
            ?>
</th>
							<td>
								<fieldset>
									<label>
										<input type="checkbox" name="wpex_tweaks[image_resizing]" <?php 
            checked(get_theme_mod('image_resizing', true));
            ?>
> <?php 
            _e('Enable the built-in image cropping and resizing functions for featured images.', 'wpex');
            ?>
									</label>
								</fieldset>
							</td>
						</tr>
						<tr valign="top">
							<th scope="row"><?php 
            _e('Trim Custom Excerpts', 'wpex');
            ?>
</th>
							<td>
								<fieldset>
									<label>
										<input type="checkbox" name="wpex_tweaks[trim_custom_excerpts]" <?php 
            checked(get_theme_mod('trim_custom_excerpts', true));
            ?>
> <?php 
            _e('Check to trim custom excerpts for the wpex_excerpt function.', 'wpex');
            ?>
									</label>
								</fieldset>
							</td>
						</tr>
						<tr valign="top">
							<th scope="row"><?php 
            _e('Retina', 'wpex');
            ?>
</th>
							<td>
								<fieldset>
									<label>
										<input type="checkbox" name="wpex_tweaks[retina]" <?php 
            checked(get_theme_mod('retina'), true);
            ?>
> <?php 
            _e('Enable retina support for your site (via retina.js).', 'wpex');
            ?>
									</label>
								</fieldset>
							</td>
						</tr>
						<tr valign="top">
							<th scope="row"><?php 
            _e('Enable Post Types', 'wpex');
            ?>
</th>
							<td>
								<fieldset>
									<?php 
            // Display post types options
            $post_types = wpex_theme_post_types();
            foreach ($post_types as $post_type) {
                if (post_type_exists($post_type)) {
                    $obj = get_post_type_object($post_type);
                    $name = $obj->labels->name;
                } else {
                    $name = ucfirst($post_type);
                }
                ?>
										<label><input type="checkbox" name="wpex_tweaks[<?php 
                echo $post_type;
                ?>
_enable]" <?php 
                checked(get_theme_mod($post_type . '_enable', true));
                ?>
> <?php 
                echo $name;
                ?>
</label>
										<br />
									<?php 
            }
            ?>
								</fieldset>
							</td>
						</tr>
						<tr valign="top">
							<th scope="row"><?php 
            _e('Remove Post Type Slugs', 'wpex');
            ?>
</th>
							<td>
								<fieldset>
									<label><input type="checkbox" name="wpex_tweaks[remove_posttype_slugs]" <?php 
            checked(get_theme_mod('remove_posttype_slugs', false));
            ?>
> <?php 
            _e('Remove Custom Post Type Slugs (Experimental)', 'wpex');
            ?>
</label>
									<p class="description"><?php 
            _e('Toggle the slug on/off for your custom post types (portfolio, staff, testimonials). Custom Post Types in WordPress by default should have a slug to prevent conflicts, you can use this setting to disable them, but be careful.', 'wpex');
            ?>
 <?php 
            _e('Please make sure to re-save your WordPress permalinks settings whenever changing this option.', 'wpex');
            ?>
</p>
								</fieldset>
							</td>
						</tr>
						<tr valign="top">
							<th scope="row"><?php 
            _e('Post Series', 'wpex');
            ?>
</th>
							<td>
							<label><input type="checkbox" name="wpex_tweaks[post_series_enable]" <?php 
            checked(get_theme_mod('post_series_enable', true));
            ?>
> <?php 
            _e('Check to enable.', 'wpex');
            ?>
</label>
							</td>
						</tr>
						<?php 
            if (get_theme_mod('post_series_enable', true)) {
                ?>
							<tr valign="top">
								<th scope="row"><?php 
                _e('Post Series Labels', 'wpex');
                ?>
</th>
								<td>
								<input type="text" name="wpex_tweaks[post_series_labels]" value="<?php 
                echo get_theme_mod('post_series_labels', __('Post Series', 'wpex'));
                ?>
">
								</td>
							</tr>
							<tr valign="top">
								<th scope="row"><?php 
                _e('Post Series Slug', 'wpex');
                ?>
</th>
								<td>
								<input type="text" name="wpex_tweaks[post_series_slug]" value="<?php 
                echo get_theme_mod('post_series_slug', 'post-series');
                ?>
">
								</td>
							</tr>
						<?php 
            }
            ?>
						<tr valign="top">
							<th scope="row"><?php 
            _e('Visual Composer', 'wpex');
            ?>
</th>
							<td>
								<fieldset>
									<label><input type="checkbox" name="wpex_tweaks[visual_composer_theme_mode]" <?php 
            checked(get_theme_mod('visual_composer_theme_mode', true));
            ?>
> <?php 
            _e(' Run Visual Composer In Theme Mode', 'wpex');
            ?>
</label><p class="description"><?php 
            _e('Please keep this option enabled unless you have purchased a full copy of the Visual Composer plugin directly from the author.', 'wpex');
            ?>
</p>
									<br />
									<label><input type="checkbox" name="wpex_tweaks[extend_visual_composer]" <?php 
            checked(get_theme_mod('extend_visual_composer', true));
            ?>
> <?php 
            _e(' Extend The Visual Composer?', 'wpex');
            ?>
</label><p class="description"><?php 
            _e('This theme includes many extensions (more modules) for the Visual Composer plugin. If you do not wish to use any disable them here.', 'wpex');
            ?>
</p>
								</fieldset>
							</td>
						</tr>
						<tr valign="top">
							<th scope="row"><?php 
            _e('Theme Branding', 'wpex');
            ?>
</th>
							<td>
								<fieldset>
									<input type="text" name="wpex_tweaks[theme_branding]" value="<?php 
            echo get_theme_mod('theme_branding', 'Total');
            ?>
">
								</fieldset>
							</td>
						</tr>
						<tr valign="top">
							<th scope="row"><?php 
            _e('Analytics Tracking Code', 'wpex');
            ?>
</th>
							<td>
								<fieldset>
									<textarea type="text" name="wpex_tweaks[tracking]" rows="5" style="min-width:25%"><?php 
            echo get_theme_mod('tracking', false);
            ?>
</textarea><p class="description"><?php 
            _e('Enter your entire tracking code (javascript).', 'wpex');
            ?>
</p>
								</fieldset>
							</td>
						</tr>
						<tr valign="top">
							<th scope="row"><?php 
            _e('Item Purchase Code', 'wpex');
            ?>
</th>
							<td>
								<fieldset>
									<input type="text" name="wpex_tweaks[envato_license_key]" value="<?php 
            echo get_theme_mod('envato_license_key', '');
            ?>
"><p class="description"><?php 
            _e('Enter your Envato license key here if you wish to receive auto updates for your theme.', 'wpex');
            ?>
</p>
								</fieldset>
							</td>
						</tr>
					</table>
					<?php 
            submit_button();
            ?>
				</form>
			</div><!-- .wrap -->
		<?php 
        }