Example #1
0
 function csadv_slogan_function($title = "enabled", $style = "")
 {
     global $s;
     $html = '';
     if (csadv_is_single()) {
         if (csadv_postmeta('csadv_slogan')) {
             $html = csadv_postmeta('csadv_slogan');
         }
         if (csadv_postmeta('csadv_subslogan')) {
             $html .= '<span>' . csadv_postmeta('csadv_subslogan') . '</span>';
         }
     } elseif (is_search()) {
         $html = "<h1 class='title'>" . __('Search results for : ', "csadv") . $s . "</h1>";
     } elseif (is_404()) {
         $html = "<h1 class='title'>" . __('Content not found', "csadv") . "</h1>";
     } elseif (is_home()) {
         $html = "<h1 class='title'>" . get_bloginfo('name') . '<span>' . get_bloginfo('description') . '</span></h1>';
     } elseif (csadv_get_archive_title()) {
         if (strstr(csadv_get_archive_title(), ':')) {
             $archive_title = explode(":", csadv_get_archive_title());
             $html = "<h1 class='title'>" . $archive_title[1] . "</h1>";
         } else {
             $html = "<h1 class='title'>" . csadv_get_archive_title() . "</h1>";
         }
     }
     if (!empty($html)) {
         echo '<div id="slogan" ' . $style . '>' . $html . '</div>';
     }
 }
Example #2
0
    function csadv_footer_sidebar_function()
    {
        $sidebarname = "footer-sidebar-area";
        $sidebar_check = true;
        if (csadv_is_single() && csadv_postmeta('csadv_footer_sidebar') == "none") {
            $sidebar_check = false;
        }
        if (is_active_sidebar($sidebarname) && $sidebar_check == true) {
            ?>

        <footer id="footer">
            
            <div class="container">
    
    			<section class="row widgets">
							
					<?php 
            dynamic_sidebar($sidebarname);
            ?>
							
                </section>
    
            </div>
            
        </footer>
    
<?php 
        }
    }
Example #3
0
 function csadv_after_content_function($type = "")
 {
     if (!csadv_is_single()) {
         do_action('csadv_excerpt');
     } else {
         if ((!csadv_postmeta('csadv_view_post_info') || csadv_postmeta('csadv_view_post_info') == "on") && $type == "post") {
             echo '<div class="line"><div class="post-info">';
             echo '<span class="genericon genericon-time"></span>' . get_the_date();
             echo '<span class="genericon genericon-category"></span>';
             the_category(', ');
             the_tags('<span class="genericon genericon-tag"></span>', ', ');
             if (!csadv_postmeta('csadv_post_icons') || csadv_postmeta('csadv_post_icons') == "on") {
                 echo csadv_posticon();
             }
             echo '</div></div>';
         }
         the_content();
         echo '<div class="clear"></div>';
     }
 }
Example #4
0
<?php

/**
 * csadvTheme
 * 
 * @author Goatshark
 *
 * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
 * It is also available at this URL: http://www.gnu.org/licenses/gpl-3.0.txt
 */
/* Template Name: Only Widget */
get_header();
if (csadv_postmeta('csadv_header_sidebar') && csadv_postmeta('csadv_header_sidebar') != "none") {
    do_action('csadv_header_sidebar', csadv_postmeta('csadv_header_sidebar'));
}
if (csadv_postmeta('csadv_bottom_sidebar') && csadv_postmeta('csadv_bottom_sidebar') != "none") {
    do_action('csadv_bottom_sidebar', csadv_postmeta('csadv_bottom_sidebar'));
}
get_footer();
Example #5
0
    public function metaboxes_panel()
    {
        $metaboxes_fields = $this->metaboxes_fields;
        global $post, $post_id;
        foreach ($metaboxes_fields as $value) {
            switch ($value['type']) {
                case 'navigation':
                    ?>
			
				<div id="tabs" class="metaboxes">
						
					<ul>
			
						<?php 
                    foreach ($value['item'] as $option => $name) {
                        echo "<li class='" . $option . "'><a href='#" . str_replace(" ", "", $option) . "'>" . $name . "</a></li>";
                    }
                    ?>
					   	
                        <li class="clear"></li>
                        
					</ul>
					   
			<?php 
                    break;
                case 'begintab':
                    ?>
			
				<div id="<?php 
                    echo $value['tab'];
                    ?>
" >
		
			<?php 
                    break;
                case 'endtab':
                    ?>
			
				</div>
		
			<?php 
                    break;
            }
            foreach ($value as $field) {
                if (isset($field['type'])) {
                    switch ($field['type']) {
                        case 'start':
                            ?>
					<div class="postformat" id="<?php 
                            echo $field['id'];
                            ?>
">
				
					<?php 
                            break;
                        case 'end':
                            ?>
					</div>
					
					<?php 
                            break;
                        case "on-off":
                            ?>
				
					<div class="wip_inputbox">
		
						<div class="input-left">
		
							<label for="<?php 
                            echo $field['id'];
                            ?>
"><?php 
                            echo $field['name'];
                            ?>
</label>
							<em><?php 
                            echo $field['desc'];
                            ?>
</em>
							
						</div>
						
                        <div class="input-right">
		
								<div class="bool-slider <?php 
                            if (csadv_postmeta($field['id']) != "") {
                                echo stripslashes(csadv_postmeta($field['id']));
                            } else {
                                echo $field['std'];
                            }
                            ?>
">
									
									<div class="inset"><div class="control"></div></div>
									
									<input name="<?php 
                            echo $field['id'];
                            ?>
" id="<?php 
                            echo $field['id'];
                            ?>
" type="hidden" value="<?php 
                            if (csadv_postmeta($field['id']) != "") {
                                echo csadv_postmeta($field['id']);
                            } else {
                                echo $field['std'];
                            }
                            ?>
" class="on-off" />
	
								</div>  
								
								<div class="clear"></div>      
						
						</div>	
							
						<div class="clear"></div>
						
					</div>
				
					<?php 
                            break;
                        case 'title':
                            ?>
					
					<h2 class="title"><?php 
                            echo $field['name'];
                            ?>
</h2>
					
					<?php 
                            break;
                        case 'text':
                            ?>
					
					<div class="wip_inputbox">
						
						<div class="input-left">
						
							<label for="<?php 
                            echo $field['id'];
                            ?>
"><?php 
                            echo $field['name'];
                            ?>
</label>
							<em> <?php 
                            echo $field['desc'];
                            ?>
 </em>
							
						</div>
						
						<div class="input-right">
						
							<input name="<?php 
                            echo $field['id'];
                            ?>
" id="<?php 
                            echo $field['id'];
                            ?>
" type="<?php 
                            echo $field['type'];
                            ?>
" value="<?php 
                            if (csadv_postmeta($field['id']) != "") {
                                echo csadv_postmeta($field['id']);
                            }
                            ?>
" style="width:100%"/>
							
						</div>
						
						<div class="clear"></div>
                        
					</div>
				
					<?php 
                            break;
                        case "color":
                            ?>
								
					<div class="wip_inputbox">
						
						<div class="input-left">
						
							<label for="<?php 
                            echo $field['id'];
                            ?>
"><?php 
                            echo $field['name'];
                            ?>
</label>
							<em> <?php 
                            echo $field['desc'];
                            ?>
 </em>
							
						</div>
						
						<div class="input-right">
						
							<input data-hex="true" name="<?php 
                            echo $field['id'];
                            ?>
" id="<?php 
                            echo $field['id'];
                            ?>
" type="<?php 
                            echo $field['type'];
                            ?>
" value="<?php 
                            if (csadv_postmeta($field['id']) != "") {
                                echo csadv_postmeta($field['id']);
                            } else {
                                echo $field['std'];
                            }
                            ?>
" style="width:90%"/>
							
						</div>
						
						<div class="clear"></div>
                        
					</div>

					<?php 
                            break;
                        case "upload":
                            ?>
				
					<div class="wip_inputbox">
				 
						<div class="input-left">
						
							<label for="<?php 
                            echo $field['id'];
                            ?>
"><?php 
                            echo $field['name'];
                            ?>
</label>
							<em> <?php 
                            echo $field['desc'];
                            ?>
 </em>
							
						</div>

						<div class="input-right">
						
							<input id="<?php 
                            echo $field['id'];
                            ?>
" type="text" name="<?php 
                            echo $field['id'];
                            ?>
" class="idattachment" value="<?php 
                            if (csadv_postmeta($field['id']) != "") {
                                echo csadv_postmeta($field['id']);
                            } else {
                                echo $field['std'];
                            }
                            ?>
" />
									
							<input type="button" name="just_button" class="button" value="<?php 
                            esc_attr_e('Upload');
                            ?>
" />
							
						</div>

						<div class="clear"></div>

					</div>
				
					<?php 
                            break;
                        case 'select':
                            ?>
					
					<div class="wip_inputbox">
						
						<div class="input-left">
						
							<label for="<?php 
                            echo $field['id'];
                            ?>
"><?php 
                            echo $field['name'];
                            ?>
</label>
							<em> <?php 
                            echo $field['desc'];
                            ?>
 </em>
							
						</div>
						
						<div class="input-right">
						
							<select name="<?php 
                            echo $field['id'];
                            ?>
" id="<?php 
                            echo $field['id'];
                            ?>
" style="width:100%">
								
								<?php 
                            foreach ($field['options'] as $option => $values) {
                                ?>
							
                                    <option <?php 
                                if (csadv_postmeta($field['id']) == $option || !csadv_postmeta($field['id']) && $field['std'] == $option) {
                                    echo 'selected="selected"';
                                }
                                ?>
 value="<?php 
                                echo $option;
                                ?>
"><?php 
                                echo $values;
                                ?>
</option>
								
								<?php 
                            }
                            ?>
  

							</select>

						</div>
						
						<div class="clear"></div>
					
                    </div>
					
					<?php 
                            break;
                        case 'taxonomy-select':
                            $slideshows = get_terms("slideshows");
                            foreach ($slideshows as $slideshow) {
                                $wp_terms[$slideshow->term_id] = $slideshow->name;
                            }
                            ?>
					
					<div class="wip_inputbox">
						<label for="<?php 
                            echo $field['id'];
                            ?>
"><?php 
                            echo $field['name'];
                            ?>
</label>
						<select name="<?php 
                            echo $field['id'];
                            ?>
" id="<?php 
                            echo $field['id'];
                            ?>
" style="width:100%">
							<option value="all"> All </option>
							<?php 
                            foreach ($wp_terms as $option => $values) {
                                ?>
							<option <?php 
                                if (csadv_postmeta($field['id']) == $option) {
                                    echo 'selected="selected"';
                                }
                                ?>
 value="<?php 
                                echo $option;
                                ?>
"><?php 
                                echo $values;
                                ?>
</option><?php 
                            }
                            ?>
						</select>
						<em> <?php 
                            echo $field['desc'];
                            ?>
 </em>
					</div>
				
				
					<?php 
                            break;
                        case 'textarea':
                            ?>
							
					<div class="wip_inputbox">
						
						<div class="input-left">
						
                        	<label for="<?php 
                            echo $field['id'];
                            ?>
"><?php 
                            echo $field['name'];
                            ?>
</label>
							<em> <?php 
                            echo $field['desc'];
                            ?>
 </em>
						
                        </div>
					
                    	<div class="input-right">
                       
                            <textarea name="<?php 
                            echo $field['id'];
                            ?>
" id="<?php 
                            echo $field['id'];
                            ?>
" type="<?php 
                            echo $field['type'];
                            ?>
" style="width:100%"><?php 
                            if (csadv_postmeta($field['id']) != "") {
                                echo stripslashes(csadv_postmeta($field['id']));
                            }
                            ?>
</textarea>
						
                        </div>
					
                    	<div class="clear"></div>
					
                    </div>
							
					<?php 
                            break;
                    }
                }
            }
        }
    }
Example #6
0
 function csadv_template($id)
 {
     $template = array("full" => "col-md-12", "left-sidebar" => "col-md-8", "right-sidebar" => "col-md-8");
     $span = $template["right-sidebar"];
     $sidebar = "right-sidebar";
     if ((is_category() || is_tag() || is_tax() || is_month()) && csadv_setting('csadv_category_layout')) {
         $span = $template[csadv_setting('csadv_category_layout')];
         $sidebar = csadv_setting('csadv_category_layout');
     } else {
         if (is_home() && csadv_setting('csadv_home')) {
             $span = $template[csadv_setting('csadv_home')];
             $sidebar = csadv_setting('csadv_home');
         } else {
             if (is_search() && csadv_setting('csadv_search_layout')) {
                 $span = $template[csadv_setting('csadv_search_layout')];
                 $sidebar = csadv_setting('csadv_search_layout');
             } else {
                 if ((is_single() || is_page()) && csadv_postmeta('csadv_template')) {
                     $span = $template[csadv_postmeta('csadv_template')];
                     $sidebar = csadv_postmeta('csadv_template');
                 }
             }
         }
     }
     return ${$id};
 }
Example #7
0
 function csadv_sidebar_name($type)
 {
     $sidebars = array("header" => array("postmeta" => "csadv_header_sidebar", "default" => "header-sidebar-area"), "side" => array("postmeta" => "csadv_sidebar", "default" => "side-sidebar-area"), "scroll" => array("postmeta" => "csadv_scroll_sidebar", "default" => "scroll-sidebar-area"), "bottom" => array("postmeta" => "csadv_bottom_sidebar", "default" => "bottom-sidebar-area"), "footer" => array("postmeta" => "csadv_footer_sidebar", "default" => "footer-sidebar-area"));
     if (csadv_is_single()) {
         $sidebar_name = csadv_postmeta($sidebars[$type]['postmeta']);
     } else {
         $sidebar_name = $sidebars[$type]['default'];
     }
     return $sidebar_name;
 }