This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Pagination | |
*/ | |
function WpDevs_pagination($pages = '', $range = 4) | |
{ | |
$showitems = ($range * 2)+1; | |
global $paged; | |
if(empty($paged)) $paged = 1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php if (function_exists("WpDevs_pagination")) { | |
WpDevs_pagination($wp_query->max_num_pages); | |
} ?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Replaces the excerpt "more" text by a link | |
*/ | |
function thirteenmag_excerpt_more($more) { | |
global $post; | |
return '<a class="moretag" href="'. get_permalink($post->ID) . '"> Read the full article <i class="fa fa-share"></i> </a>'; | |
} | |
add_filter('excerpt_more', 'thirteenmag_excerpt_more'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if ( is_home() ) { | |
query_posts( 'cat=-3' ); | |
} | |
?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if ( is_home() ) { | |
query_posts( 'cat=-1,-2,-3' ); | |
} | |
?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Filters wp_title to print a neat <title> tag based on what is being viewed. | |
* | |
* @param string $title Default title text for current view. | |
* @param string $sep Optional separator. | |
* @return string The filtered title. | |
*/ | |
function WpDevs_wp_title( $title, $sep ) { | |
if ( is_feed() ) { | |
return $title; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
*Custom Post Types | |
*/ | |
function wpdevs_custom_post() { | |
register_post_type( 'news-posts', | |
array( | |
'labels' => array( | |
'name' => __( 'News Posts', 'hellothirteen' ), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!--NEWS SECTION--> | |
<?php | |
global $post; | |
$args = array ('post_type'=> 'news-posts','posts_per_page' =>3); | |
$the_query = new WP_Query($args); ?> | |
<?php if ( $the_query->have_posts() ) : ?> | |
<?php while ($the_query->have_posts()) : $the_query->the_post(); ?> |