Ejemplo n.º 1
0
function page_sllider_settings($args)
{
    global $post;
    $tpl_default_settings = get_post_meta($post->ID, '_tpl_default_settings', TRUE);
    $tpl_default_settings = is_array($tpl_default_settings) ? $tpl_default_settings : array();
    ?>

		<!-- Show Slider -->        
        <div class="custom-box">
        	<div class="column one-sixth">
                <label><?php 
    _e('Show Slider', 'iamd_text_domain');
    ?>
 </label>
            </div>
            <div class="column four-sixth last">
				<?php 
    $switchclass = array_key_exists("show_slider", $tpl_default_settings) ? 'checkbox-switch-on' : 'checkbox-switch-off';
    $checked = array_key_exists("show_slider", $tpl_default_settings) ? ' checked="checked"' : '';
    ?>
                <div data-for="mytheme-show-slider" class="checkbox-switch <?php 
    echo $switchclass;
    ?>
"></div>
                <input id="mytheme-show-slider" class="hidden" type="checkbox" name="mytheme-show-slider" value="true"  <?php 
    echo $checked;
    ?>
/>
                <p class="note"> <?php 
    _e('YES! to show slider on this page.', 'iamd_text_domain');
    ?>
 </p>
            </div>
        </div><!-- Show Slider End-->

        <!-- Slider Types -->
        <div class="custom-box">
        	<div class="column one-sixth">
                <label><?php 
    _e('Choose Slider', 'iamd_text_domain');
    ?>
</label>
            </div>
            <div class="column four-sixth last">
	            <?php 
    $slider_types = array('' => __("Select", 'iamd_text_domain'), 'layerslider' => __("Layer Slider", 'iamd_text_domain'), 'revolutionslider' => __("Revolution Responsive", 'iamd_text_domain'));
    $v = array_key_exists("slider_type", $tpl_default_settings) ? $tpl_default_settings['slider_type'] : '';
    echo "<select class='slider-type' name='mytheme-slider-type'>";
    foreach ($slider_types as $key => $value) {
        $rs = selected($key, $v, false);
        echo "<option value='{$key}' {$rs}>{$value}</option>";
    }
    echo "</select>";
    ?>
            <p class="note"> <?php 
    _e("Choose which slider you wish to use ( eg: Layer or Revolution )", 'iamd_text_domain');
    ?>
 </p>
            </div>
        </div><!-- Slider Types End-->
        
        <!-- slier-container starts-->
    	<div id="slider-conainer">
        <?php 
    $layerslider = $revolutionslider = 'style="display:none"';
    if (isset($tpl_default_settings['slider_type']) && $tpl_default_settings['slider_type'] == "layerslider") {
        $layerslider = 'style="display:block"';
    } elseif (isset($tpl_default_settings['slider_type']) && $tpl_default_settings['slider_type'] == "revolutionslider") {
        $revolutionslider = 'style="display:block"';
    }
    ?>
              
          
              <!-- Layered Slider -->
              <div id="layerslider" class="custom-box" <?php 
    echo $layerslider;
    ?>
>
              	<h3><?php 
    _e('Layer Slider', 'iamd_text_domain');
    ?>
</h3>
                <?php 
    if (dtthemes_mytheme_is_plugin_active('LayerSlider/layerslider.php')) {
        ?>
                <?php 
        // Get WPDB Object
        global $wpdb;
        // Table name
        $table_name = $wpdb->prefix . "layerslider";
        // Get sliders
        $sliders = $wpdb->get_results("SELECT * FROM {$table_name} WHERE flag_hidden = '0' AND flag_deleted = '0'  ORDER BY date_c ASC LIMIT 100");
        if ($sliders != null && !empty($sliders)) {
            echo '<div class="one-half-content">';
            echo '	<div class="bpanel-option-set">';
            echo ' <div class="column one-sixth">';
            echo '	<label>' . __('Select LayerSlider', 'iamd_text_domain') . '</label>';
            echo ' 	</div>';
            echo ' <div class="column two-sixth">';
            echo '	<select name="layerslider_id">';
            echo '		<option value="0">' . __("Select Slider", 'iamd_text_domain') . '</option>';
            foreach ($sliders as $item) {
                $name = empty($item->name) ? 'Unnamed' : $item->name;
                $id = $item->id;
                $rs = isset($tpl_default_settings['layerslider_id']) ? $tpl_default_settings['layerslider_id'] : '';
                $rs = selected($id, $rs, false);
                echo "\t<option value='{$id}' {$rs}>{$name}</option>";
            }
            echo '	</select>';
            echo '<p class="note">';
            _e("Choose Which LayerSlider you would like to use..", 'iamd_text_domain');
            echo "</p>";
            echo ' 	</div>';
            echo '	</div>';
            echo '</div>';
        } else {
            echo '<p id="j-no-images-container">' . __('Please add atleat one layer slider', 'iamd_text_domain') . '</p>';
        }
        ?>
                      
					<?php 
        $layersliders = get_option('layerslider-slides');
        if ($layersliders) {
            $layersliders = is_array($layersliders) ? $layersliders : unserialize($layersliders);
            foreach ($layersliders as $key => $val) {
                $layersliders_array[$key + 1] = 'LayerSlider #' . ($key + 1);
            }
            echo '<div class="one-half-content">';
            echo '	<div class="bpanel-option-set">';
            echo ' <div class="column one-sixth">';
            echo '	<label>' . __('Select LayerSlider', 'iamd_text_domain') . '</label>';
            echo '</div>';
            echo ' <div class="column two-sixth">';
            echo '	<select name="layerslider_id">';
            echo '		<option value="0">' . __("Select Slider", 'iamd_text_domain') . '</option>';
            foreach ($layersliders_array as $key => $value) {
                $rs = isset($tpl_default_settings['layerslider_id']) ? $tpl_default_settings['layerslider_id'] : '';
                $rs = selected($key, $rs, false);
                echo "\t<option value='{$key}' {$rs}>{$value}</option>";
            }
            echo '	</select>';
            echo '<p class="note">';
            _e("Choose which LayerSlider would you like to use!", 'iamd_text_domain');
            echo "</p>";
            echo '</div>';
            echo '	</div>';
            echo '</div>';
        }
    } else {
        ?>
                      <p id="j-no-images-container"><?php 
        _e('Please activate Layered Slider', 'iamd_text_domain');
        ?>
</p>
               <?php 
    }
    ?>
         
                
              </div><!-- Layered Slider End-->

              <!-- Revolution Slider -->
              <div id="revolutionslider" class="custom-box" <?php 
    echo $revolutionslider;
    ?>
>
	            <h3><?php 
    _e('Revolution Slider', 'iamd_text_domain');
    ?>
</h3>
                <?php 
    $return = dtthemes_check_slider_revolution_responsive_wordpress_plugin();
    if ($return) {
        echo '<div class="one-half-content">';
        echo '	<div class="bpanel-option-set">';
        echo ' <div class="column one-sixth">';
        echo '	<label>' . __('Select Slider', 'iamd_text_domain') . '</label>';
        echo '</div>';
        echo ' <div class="column three-sixth">';
        echo '	<select name="revolutionslider_id">';
        echo '		<option value="0">' . __("Select Slider", 'iamd_text_domain') . '</option>';
        foreach ($return as $key => $value) {
            $rs = isset($tpl_default_settings['revolutionslider_id']) ? $tpl_default_settings['revolutionslider_id'] : '';
            $rs = selected($key, $rs, false);
            echo "\t<option value='{$key}' {$rs}>{$value}</option>";
        }
        echo '</select>';
        echo '<p class="note">';
        _e("Choose which Revolution slider would you like to use!", 'iamd_text_domain');
        echo "</p>";
        echo '</div>';
        echo '	</div>';
        echo '</div>';
    } else {
        ?>
	                	<p id="j-no-images-container"><?php 
        _e('Please activate Revolution Slider , and add at least one slider.', 'iamd_text_domain');
        ?>
</p>
                <?php 
    }
    ?>
              </div><!-- Revolution Slider End-->
        </div><!-- slier-container ends-->

        
	
<?php 
    wp_reset_postdata();
}
Ejemplo n.º 2
0
function dtthemes_mytheme_seo_meta()
{
    $status = dtthemes_mytheme_is_plugin_active('all-in-one-seo-pack/all_in_one_seo_pack.php') || dtthemes_mytheme_is_plugin_active('wordpress-seo/wp-seo.php');
    if (!$status) {
        global $post;
        $output = "";
        $meta_description = '';
        $meta_keywords = '';
        $pageid = get_option('page_on_front');
        $template = get_post_meta($pageid, '_wp_page_template', true);
        if (is_feed()) {
            return;
        }
        if (is_404() || is_search()) {
            return;
        }
        # meta robots Noindex ,NoFollow
        if (is_category() && dtthemes_mytheme_option('seo', 'use_noindex_in_cats_page')) {
            $output .= '<meta name="robots" content="noindex,follow" />' . "\r";
        } elseif (is_archive() && dtthemes_mytheme_option('seo', 'use_noindex_in_archives_page')) {
            $output .= '<meta name="robots" content="noindex,follow" />' . "\r";
        } elseif (is_tag() && !dtthemes_mytheme_option('seo', 'use_noindex_in_tags_archieve_page')) {
            $output .= '<meta name="robots" content="noindex,follow" />' . "\r";
        }
        #End
        ### Meta Description ###
        if (is_home() || is_front_page()) {
            $meta_description = get_post_meta($post->ID, '_seo_description', true);
        } elseif (is_page()) {
            $meta_description = get_post_meta($post->ID, '_seo_description', true);
            if (empty($meta_description) && dtthemes_mytheme_option('seo', 'auto_generate_desc')) {
                $meta_description = substr(strip_shortcodes(strip_tags($post->post_content)), 0, 155);
            }
            #post
        } elseif (is_singular() || is_single()) {
            $meta_description = get_post_meta($post->ID, '_seo_description', true);
            if (empty($meta_description) && dtthemes_mytheme_option('seo', 'auto_generate_desc')) {
                $meta_description = trim(substr(strip_shortcodes(strip_tags($post->post_content)), 0, 155));
            }
            #is_category()
        } elseif (is_category()) {
            #$categories = get_the_category();
            #$meta_description = $categories[0]->description;
            $meta_description = strip_tags(category_description());
            #is_tag()
        } elseif (is_tag()) {
            $meta_description = strip_tags(tag_description());
            #is_author
        } elseif (is_author()) {
            $author_id = get_query_var('author');
            if (!empty($author_id)) {
                $meta_description = get_the_author_meta('description', $author_id);
            }
        }
        if (!empty($meta_description)) {
            $meta_description = trim(substr($meta_description, 0, 155));
            $meta_description = htmlspecialchars($meta_description);
            $output .= "<meta name='description' content='{$meta_description}' />\r";
        }
        ### Meta Description End###
        if (is_home() || is_front_page()) {
            $meta_keywords = get_post_meta($post->ID, '_seo_keywords', true);
        } elseif (is_page()) {
            $meta_keywords = get_post_meta($post->ID, '_seo_keywords', true);
            #post
        } elseif (is_singular() || is_single()) {
            $meta_keywords = get_post_meta($post->ID, '_seo_keywords', true);
            #Use Categories in Keyword
            if (dtthemes_mytheme_option('seo', 'use_cats_in_meta_keword')) {
                $categories = get_the_category();
                $c = '';
                foreach ($categories as $category) {
                    $c .= $category->name . ',';
                }
                $c = substr(trim($c), "0", strlen(trim($c)) - 1);
                $meta_keywords = $meta_keywords . ',' . $c;
            }
            #Use Tags in Keyword
            if (dtthemes_mytheme_option('seo', 'use_tags_in_meta_keword')) {
                $posttags = get_the_tags();
                $ptags = '';
                if ($posttags) {
                    foreach ($posttags as $posttag) {
                        $ptags .= $posttag->name . ',';
                    }
                    $ptags = substr(trim($ptags), "0", strlen(trim($ptags)) - 1);
                    $meta_keywords = $meta_keywords . ',' . $ptags;
                }
            }
            #Archive
        } elseif (is_archive()) {
            global $posts;
            $keywords = array();
            foreach ($posts as $post) {
                # If attachment then use parent post id
                $id = is_attachment() ? $post->post_parent : (!empty($post->ID) ? $post->ID : '');
                $keywords_from_posts = get_post_meta($id, '_seo_keywords', true);
                if (!empty($keywords_from_posts)) {
                    $traverse = explode(',', $keywords_from_posts);
                    foreach ($traverse as $keyword) {
                        $keywords[] = $keyword;
                    }
                }
                #Use Tags in Keyword
                if (dtthemes_mytheme_option('seo', 'use_tags_in_meta_keword')) {
                    $tags = get_the_tags($id);
                    if ($tags && is_array($tags)) {
                        foreach ($tags as $tag) {
                            $keywords[] = $tag->name;
                        }
                    }
                }
                #Use categories in Keywords
                if (dtthemes_mytheme_option('seo', 'use_cats_in_meta_keword')) {
                    $categories = get_the_category($id);
                    foreach ($categories as $category) {
                        $keywords[] = $category->cat_name;
                    }
                }
            }
            # Make keywords lowercase
            $keywords = array_unique($keywords);
            $small_keywords = array();
            $final_keywords = array();
            foreach ($keywords as $word) {
                $final_keywords[] = strtolower($word);
            }
            if (!empty($final_keywords)) {
                $meta_keywords = implode(",", $final_keywords);
            }
            #search || 404 page
        } elseif (is_404() || is_search()) {
            $meta_keywords = '';
        }
        if (!empty($meta_keywords)) {
            $output .= "\t<meta name='keywords' content='{$meta_keywords}'/>\r";
        }
        ### Meta Keyword End###
        #Generate canonical_url
        if (dtthemes_mytheme_option('seo', 'use_canonical_urls')) {
            $url = dtthemes_mytheme_canonical();
            if ($url) {
                $output .= "<link rel='canonical' href='{$url}'/>\r";
            }
        }
        echo $output;
    }
}
Ejemplo n.º 3
0
/**
 * dtthemes_check_slider_revolution_responsive_wordpress_plugin()
 * Objective:
 * Check the "Revolution Responsive WordPress Plugin" is activated
 */
function dtthemes_check_slider_revolution_responsive_wordpress_plugin()
{
    $sliders = false;
    if (dtthemes_mytheme_is_plugin_active('revslider/revslider.php')) {
        global $wpdb;
        // table_prefix = WP_ALLOW_MULTISITE ? $wpdb->base_prefix : $wpdb->prefix;
        $table_prefix = $wpdb->prefix;
        $table_name = $table_prefix . "revslider_sliders";
        if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
            $resultset = $wpdb->get_results("SELECT title,alias FROM {$table_name}");
            foreach ($resultset as $rs) {
                $sliders[$rs->alias] = $rs->title;
            }
            return $sliders;
        } else {
            return $sliders;
        }
    } else {
        return $sliders;
    }
}
            the_permalink();
            ?>
" class="link"><span class="icon-fullscreen"></span></a>
                                                    <a href="<?php 
            echo $popup;
            ?>
" class="zoom" data-gal="prettyPhoto[gallery]" title="<?php 
            echo the_title();
            ?>
"><span class="icon-search"></span></a>
                                                    <p><?php 
            the_terms($post->ID, 'portfolio_tags');
            ?>
</p>
                                                    <?php 
            if (dtthemes_mytheme_is_plugin_active('roses-like-this/likethis.php')) {
                ?>
                                                        <span class="views"><i class="icon-heart"></i><?php 
                printLikes($post->ID);
                ?>
</span>
                                                    <?php 
            }
            ?>
 
                                                </div>
                                            </div>
									
                                          
                                            <div class="portfolio-detail">
                                                <h4>
Ejemplo n.º 5
0
<?php

$status = dtthemes_mytheme_is_plugin_active('all-in-one-seo-pack/all_in_one_seo_pack.php') || dtthemes_mytheme_is_plugin_active('wordpress-seo/wp-seo.php');
if (!$status) {
    add_action("admin_init", "seo_metabox");
}
function seo_metabox()
{
    $posts = array("post", "page");
    foreach ($posts as $post) {
        add_meta_box("seo-meta-container", __('SEO Options', 'dt_rise'), "seo_settings", "{$post}", "normal", "high");
        add_action('save_post', 'seo_meta_save');
    }
}
function seo_settings($args)
{
    global $post;
    ?>
        <div class="custom-box">
            <div class="column one-sixth">
                <label><?php 
    _e('Title', 'dt_rise');
    ?>
 </label>
            </div>
            <div class="column five-sixth last">      
                <input name="_seo_title" type="text" class="large"  value="<?php 
    echo get_post_meta($post->ID, '_seo_title', true);
    ?>
" />
                <p class="three-fourth note"> <?php 
Ejemplo n.º 6
0
/** mytheme_options_page()
  * Objective:
  *		To create thme option page at back end.
**/
function mytheme_options_page()
{
    ?>
<!-- wrapper -->
<div id="wrapper">

	<!-- Result -->
    <div id="bpanel-message" style="display:none;"></div>
    <div id="ajax-feedback" style="display:none;"><img src="<?php 
    echo IAMD_FW_URL . 'theme_options/images/loading.png';
    ?>
" alt="" title=""/> </div>
    <!-- Result -->


	<!-- panel-wrap -->
	<div id="panel-wrap">
    
       	<!-- bpanel-wrapper -->
        <div id="bpanel-wrapper">
        
           	<!-- bpanel -->
           	<div id="bpanel">
            
                	<!-- bpanel-left -->
                	<div id="bpanel-left">
                    	<div id="logo"> 
                        <?php 
    $logo = IAMD_FW_URL . 'theme_options/images/logo.png';
    $advance = dtthemes_mytheme_option('advance');
    if (isset($advance['buddhapanel-logo-url']) && isset($advance['enable-buddhapanel-logo-url'])) {
        $logo = $advance['buddhapanel-logo-url'];
    }
    ?>
                        <img src="<?php 
    echo $logo;
    ?>
" width="186" height="101" alt="" title="" /> </div>                        
                        <?php 
    $status = dtthemes_mytheme_is_plugin_active('all-in-one-seo-pack/all_in_one_seo_pack.php') || dtthemes_mytheme_is_plugin_active('wordpress-seo/wp-seo.php');
    $tabs = NULL;
    if (!$status) {
        $tabs = array(array('id' => 'general', 'name' => __('General', 'dt_rise')), array('id' => 'appearance', 'name' => __('Appearance', 'dt_rise')), array('id' => 'skin', 'name' => __('Skins', 'dt_rise')), array('id' => 'integration', 'name' => __('Integration', 'dt_rise')), array('id' => 'seo', 'name' => __('SEO', 'dt_rise')), array('id' => 'specialty-pages', 'name' => __('Speciality Pages', 'dt_rise')), array('id' => 'theme-footer', 'name' => __('Footer', 'dt_rise')), array('id' => 'widgetarea', 'name' => __('Widget Area', 'dt_rise')), array('id' => 'mobile', 'name' => __('Responsive &amp; Mobile', 'dt_rise')), array('id' => 'branding', 'name' => __('Branding', 'dt_rise')), array('id' => 'backup', 'name' => __('Backup', 'dt_rise')));
    } else {
        $tabs = array(array('id' => 'general', 'name' => __('General', 'dt_rise')), array('id' => 'appearance', 'name' => __('Appearance', 'dt_rise')), array('id' => 'skin', 'name' => __('Skins', 'dt_rise')), array('id' => 'integration', 'name' => __('Integration', 'dt_rise')), array('id' => 'specialty-pages', 'name' => __('Speciality Pages', 'dt_rise')), array('id' => 'theme-footer', 'name' => __('Footer', 'dt_rise')), array('id' => 'widgetarea', 'name' => __('Widget Area', 'dt_rise')), array('id' => 'mobile', 'name' => __('Responsive &amp; Mobile', 'dt_rise')), array('id' => 'branding', 'name' => __('Branding', 'dt_rise')), array('id' => 'backup', 'name' => __('Backup', 'dt_rise')));
    }
    $output = "<!-- bpanel-mainmenu -->\n\t\t\t\t\t\t<ul id='bpanel-mainmenu'>\n";
    foreach ($tabs as $tab) {
        $output .= "\t\t\t\t\t\t\t\t<li><a href='#{$tab['id']}' title='{$tab['name']}'><span class='{$tab['id']}'></span>{$tab['name']}</a></li>\n";
    }
    $output .= "\t\t\t\t\t\t</ul><!-- #bpanel-mainmenu -->\n";
    echo $output;
    ?>
                    </div><!-- #bpanel-left  end-->
                    
                    <form id="mytheme_options_form" name="mytheme_options_form" method="post" action="options.php">
		                <?php 
    settings_fields(IAMD_THEME_SETTINGS);
    ?>
                        <input type="hidden" id="mytheme-full-submit" name="mytheme-full-submit" value="0" />
                        <input type="hidden" name="mytheme_admin_wpnonce" value="<?php 
    echo wp_create_nonce(IAMD_THEME_SETTINGS . '_wpnonce');
    ?>
" />
                        <div class="top-links">
                            <?php 
    $import_disable = dtthemes_mytheme_option('general', 'disable-import') == "on" ? "import-disabled" : "";
    ?>
                        
	                        <a class="mytheme-import-button bpanel-button blue-btn <?php 
    echo $import_disable;
    ?>
"><?php 
    _e('Import Dummy Data', 'dt_rise');
    ?>
</a>
                        </div>
                        
                    	<?php 
    require_once TEMPLATEPATH . '/framework/theme_options/general.php';
    ?>
                        <?php 
    require_once TEMPLATEPATH . '/framework/theme_options/appearance.php';
    ?>
                        <?php 
    require_once TEMPLATEPATH . '/framework/theme_options/integration.php';
    ?>
                        <?php 
    require_once TEMPLATEPATH . '/framework/theme_options/specialty-pages.php';
    ?>
                        <?php 
    require_once TEMPLATEPATH . '/framework/theme_options/footer.php';
    ?>
                        <?php 
    require_once TEMPLATEPATH . '/framework/theme_options/widgetarea.php';
    ?>
						<?php 
    require_once TEMPLATEPATH . '/framework/theme_options/responsive.php';
    ?>
                        <?php 
    require_once TEMPLATEPATH . '/framework/theme_options/branding.php';
    ?>
                        <?php 
    require_once TEMPLATEPATH . '/framework/theme_options/skins.php';
    if (!$status) {
        require_once TEMPLATEPATH . '/framework/theme_options/seo.php';
    }
    ?>
                        <?php 
    require_once TEMPLATEPATH . '/framework/theme_options/backup.php';
    ?>
						<!-- #bpanel-bottom -->
                        <div id="bpanel-bottom">
                           <input type="submit" value="<?php 
    _e('Reset All', 'dt_rise');
    ?>
" class="save-reset mytheme-reset-button bpanel-button white-btn" name="mytheme[reset]" />
						   <input type="submit" value="<?php 
    _e('Save All', 'dt_rise');
    ?>
" name="submit"  class="save-reset mytheme-footer-submit bpanel-button white-btn" />
                        </div><!-- #bpanel-bottom end-->        
                    </form>

            </div><!-- #bpanel -->
            
            
            
        </div><!-- #bpanel-wrapper -->
    </div><!-- #panel-wrap end -->
</div><!-- #wrapper end-->
<?php 
}