Exemple #1
0
" title="<?php 
        printf(esc_attr__('Permalink to %s', 'cyberchimps'), the_title_attribute('echo=0'));
        ?>
" rel="bookmark">
						<?php 
        get_the_title() ? the_title() : the_permalink();
        ?>
					</a>
				<?php 
    } elseif ($page_title == "1" || $page_title == "") {
        get_the_title() ? the_title() : the_permalink();
    }
} else {
    if ('post' == get_post_type() && is_single()) {
        // get the post title toggle option
        $post_title = cyberchimps_option('single_post_title');
        if ($post_title == "1") {
            ?>
						<a href="<?php 
            the_permalink();
            ?>
" title="<?php 
            printf(esc_attr__('Permalink to %s', 'cyberchimps'), the_title_attribute('echo=0'));
            ?>
" rel="bookmark"><?php 
            get_the_title() ? the_title() : the_permalink();
            ?>
</a>
			<?php 
        }
    } else {
Exemple #2
0
    ?>
					<?php 
    _e('Oops! That page cannot be found.', 'cyberchimps');
    ?>
</h2>
          <?php 
}
?>
			</header>

			<div class="entry-content">
      	<?php 
if (cyberchimps_option('error_custom_content') != '') {
    ?>
        	<p><?php 
    echo cyberchimps_option('error_custom_content');
    ?>
</p>
        <?php 
} else {
    ?>
					<p><?php 
    _e('It looks like nothing was found at this location. Maybe try searching for it?', 'cyberchimps');
    ?>
</p>
				<?php 
}
?>
				<?php 
get_search_form();
?>
Exemple #3
0
function cyberchimps_blog_excerpt_length($length)
{
    global $post;
    if (cyberchimps_option('blog_excerpt_length') != '') {
        $length = cyberchimps_option('blog_excerpt_length');
        return $length;
    } else {
        $length = 55;
        return $length;
    }
}
function cyberchimps_recent_posts_content()
{
    global $wp_query, $custom_excerpt, $post;
    $custom_excerpt = 'recent';
    if (is_page()) {
        $title = get_post_meta($post->ID, 'cyberchimps_recent_posts_title', true);
        $toggle = get_post_meta($post->ID, 'cyberchimps_recent_posts_title_toggle', true);
        $recent_posts_image = get_post_meta($post->ID, 'cyberchimps_recent_posts_images_toggle', true);
        $category = get_post_meta($post->ID, 'cyberchimps_recent_posts_category', true);
    } else {
        $title = cyberchimps_option('recent_posts_custom_title');
        $toggle = cyberchimps_option('recent_posts_title');
        $recent_posts_image = cyberchimps_option('recent_posts_images');
        if (cyberchimps_option('recent_posts_post_cats') != 'all') {
            $category = get_the_category(cyberchimps_option('recent_posts_post_cats'));
            $category = $category[0]->name;
        } else {
            $category = 'all';
        }
    }
    if ($category != 'all') {
        $blogcategory = $category;
    } else {
        $blogcategory = "";
    }
    $args = array('numberposts' => 4, 'post__not_in' => get_option('sticky_posts'), 'category_name' => $blogcategory);
    $recent_posts = get_posts($args);
    ?>
	<div class="row-fluid">
		<div id="recent_posts">
			<?php 
    if ($toggle == '1' or $toggle == 'on') {
        ?>
				<h2 class="entry-title"><?php 
        echo $title;
        ?>
</h2>
			<?php 
    }
    ?>
			<div id="recent_posts_wrap">
			
			<?php 
    if ($recent_posts) {
        foreach ($recent_posts as $post) {
            setup_postdata($post);
            ?>
					<div id="recent-posts-container" class="span3">
					
						<h5 class="recent_posts_post_title"><a href="<?php 
            the_permalink();
            ?>
"><?php 
            the_title();
            ?>
</a></h5>
						<h6 class="recent_posts_byline">
							<?php 
            the_time('m/d/y');
            ?>
 - <?php 
            the_category(', ');
            ?>
 - 
							<?php 
            comments_popup_link('No Comments', '1 Comment', '% Comments');
            ?>
						</h6>
						<?php 
            if (has_post_thumbnail() && $recent_posts_image == '1' or has_post_thumbnail() && $recent_posts_image == 'on') {
                echo '<div class="recent-posts-image">';
                echo '<a href="' . get_permalink($post->ID) . '" >';
                the_post_thumbnail('small');
                echo '</a>';
                echo '</div>';
            }
            ?>
						<?php 
            add_filter('excerpt_more', 'cyberchimps_recent_post_excerpt_more');
            ?>
						<?php 
            the_excerpt();
            ?>
	
            <?php 
            remove_filter('excerpt_more', 'cyberchimps_recent_post_excerpt_more');
            ?>
					</div>
				<?php 
        }
        wp_reset_postdata();
        ?>
				
				<div class="clear"></div>
				
			<?php 
    } else {
        ?>
				
				<h2>Not Found</h2>
				
			<?php 
    }
    ?>
			
			</div>
		</div>
	</div>
<?php 
}