content-page.php

Download Link
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
<?php $tpl_default_settings = get_post_meta($post->ID,'_tpl_default_settings',TRUE);
	  $tpl_default_settings = is_array($tpl_default_settings) ? $tpl_default_settings  : array();
	  
  	  $page_layout = isset($tpl_default_settings['layout']) ? $tpl_default_settings['layout'] : "content-full-width";
	  $show_sidebar = false;
	  
	  switch($page_layout):
		case 'content-full-width':
			$page_layout 	= 	"content-full-width";
		break;
		
		case 'with-left-sidebar':
			$page_layout 	=	"with-left-sidebar";
			$show_sidebar 	= 	true;
		break;
		
		case 'with-right-sidebar':
			$page_layout 	=	"with-right-sidebar";
			$show_sidebar 	= 	true;
		break;
		
		default:
			$page_layout 	= 	"content-full-width";
		break;
	endswitch;
	
	$bg = "";
	$pattern="";
	
	#Article BG Style
	$article_bg_type = "";
	$article_bg_pattern = "";

	$custom_style = 'style="';
	
	#Font Style Settings
	$set_font = isset( $tpl_default_settings['font-settings'] ) ? $tpl_default_settings['font-settings'] : NULL;
	$bg .= isset( $set_font ) ? " custom-font-color " : "";
	if( $set_font  && isset($tpl_default_settings['page-font-color']) ):
		$custom_style .="color:".$tpl_default_settings['page-font-color'].";";
	endif;
	
	$anchor_colors = "";
	if( $set_font && isset($tpl_default_settings['page-primary-color']) ):
		$anchor_colors .=  "data-for-primary-color = '".$tpl_default_settings['page-primary-color']."'";
	endif;

	if( $set_font && isset($tpl_default_settings['page-secondary-color']) ):
		$anchor_colors .=  "data-for-secondary-color = '".$tpl_default_settings['page-secondary-color']."'";
	endif;

	if( $set_font && isset($tpl_default_settings['page-title-color']) ):
		$anchor_colors .=  "data-for-title-color = '".$tpl_default_settings['page-title-color']."'";
	endif;
	#Font Style Settings End
				
				
	#Article BG Style
	$page_bg_type = isset( $tpl_default_settings['page-bg-type'] ) ? $tpl_default_settings['page-bg-type'] : NULL;
	
	if( $page_bg_type ):
		if( "bg-patterns" == $page_bg_type ):
		
			$page_bg_pattern = isset( $tpl_default_settings['page-bg-pattern'] ) ? $tpl_default_settings['page-bg-pattern'] : NULL;
			if( !empty($page_bg_pattern) ):
				$url = IAMD_FW_URL.'theme_options/images/pattern/bg-patterns/'.$page_bg_pattern;
				$custom_style .= 'background-image: url('.$url.');';
				$custom_style .= isset( $tpl_default_settings['page-bg-pattern-repeat'] ) ?' background-repeat:'.$tpl_default_settings['page-bg-pattern-repeat'].';' : "";
			endif;
			
			if( !array_key_exists('disable-page-bg-pattern-color',$tpl_default_settings) && array_key_exists('page-bg-pattern-color',$tpl_default_settings) ):
				$color = hex2rgb( $tpl_default_settings['page-bg-pattern-color']);
				
				$custom_style .= isset( $tpl_default_settings['page-bg-pattern-opacity'] ) ?
						 " background-color:rgba($color[0],$color[1],$color[2],".$tpl_default_settings['page-bg-pattern-opacity'].");" :
						 " background-color:".$tpl_default_settings['page-bg-pattern-color'].";";
			endif;
			
		elseif( "bg-custom" == $page_bg_type ):
			$page_bg_pattern = isset( $tpl_default_settings['page-custom-bg'] ) ? $tpl_default_settings['page-custom-bg'] : NULL;
			if( !empty($page_bg_pattern) ):
				$custom_style .= 'background-image: url('.$page_bg_pattern.');';
				$custom_style .= isset( $tpl_default_settings['page-custom-bg-repeat'] ) ?' background-repeat:'.$tpl_default_settings['page-custom-bg-repeat'].';' : "";
				$custom_style .= isset( $tpl_default_settings['page-custom-bg-position'] ) ?' background-position:'.$tpl_default_settings['page-custom-bg-position'].';' : "";
			endif;
			
			if( !array_key_exists('disable-page-custom-bg-color',$tpl_default_settings) && array_key_exists('page-custom-bg-color',$tpl_default_settings) ):
				$color = hex2rgb( $tpl_default_settings['page-custom-bg-color']);
				$custom_style .= isset( $tpl_default_settings['page-custom-bg-opacity'] ) ?
						 " background-color:rgba($color[0],$color[1],$color[2],".$tpl_default_settings['page-custom-bg-opacity'].");" :
						 " background-color:".$tpl_default_settings['page-custom-bg-color'].";";
			endif;
			
		endif;
	endif;
	#Article BG Style
				
	$custom_style .= '"';
				
	$bg .= isset( $tpl_default_settings['dark-bg']) ? "dark-bg": "";
	$pattern = isset( $tpl_default_settings['apply-pattern']) && isset( $tpl_default_settings['pattern'] )? $tpl_default_settings['apply-pattern'] :NULL;
	if($pattern):
		$url = IAMD_FW_URL.'theme_options/images/pattern/'.$tpl_default_settings['pattern'];
		$pattern =  'style="background-image: url('.$url.')"';
	endif;?>
<!-- .content -->      
<article id="<?php the_slug(); ?>" class="content <?php echo $bg;?>" <?php echo $custom_style.$anchor_colors;?>>
	<div class="pattern" <?php echo $pattern;?>>
    
        <!-- **Container** -->
        <div class="container">
        	<div class="hr-invisible"> </div>
            
            <hgroup class="main-title">
            	<h1><?php the_title();?></h1>
                <?php if(isset($tpl_default_settings['sub-title']) && !empty($tpl_default_settings['sub-title'])):
					  	echo "<h6>".$tpl_default_settings['sub-title']."</h6>";
					  endif;?>
            </hgroup>
            
            <div class="hr-invisible"> </div>
            
            <section id="primary" class="<?php echo $page_layout;?>">
            
				<?php the_content(); ?>
                
                <?php wp_link_pages( array('before'=>'<div class="page-link">',	'after'=>'</div>', 'link_before'=>'<span>', 'link_after'=>'</span>', 'next_or_number'=>'number',
                                           'pagelink' => '%', 'echo' => 1 ) );?>
                                           
                <div class="social-bookmark">
					<?php show_fblike('page');?>
                    <?php show_googleplus('page');?>
                    <?php show_twitter('page');?>
                    <?php show_stumbleupon('page');?>
                    <?php show_linkedin('page');?>
                    <?php show_delicious('page');?>
                    <?php show_pintrest('page');?>
                    <?php show_digg('page');?>
                </div>
                                           
				<?php mytheme_social_bookmarks('sb-page'); ?>
                
                <?php edit_post_link( __( ' Edit ',IAMD_TEXT_DOMAIN ) ); ?>

                <?php $mytheme_options = get_option(IAMD_THEME_SETTINGS);
					  $mytheme_general = $mytheme_options['general']; 
					  if( (!$mytheme_general['disable-page-comment']) && ($tpl_default_settings['comment']) ):?>
                      	<div class="hr"> </div>
                        <?php  comments_template('', true); ?>
                <?php endif;?>

            </section>

            <?php if($show_sidebar): ?>
            		<!-- **Sidebar** -->
            		<div id="secondary">
            			<?php get_sidebar();?>
            		</div><!-- **Sidebar End** -->
           <?php endif;?>
            
        </div><!-- **Container end** -->
            
    </div>
</article><!-- .content -->