-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
+ Add commented line in custom-post-type.php + Fix display description for CPT in Archive page archive.php line 34, now display description for all custom post without type slug + Fix ID's name for author.php (chage in author-page) + Add <?php create_breadcrumbs() ?> to search.php + Improve breacrumb.php, now show custom_post_type name + Improve Read more link in excerpt function (custom_excerpt.php) + Fix domain name in single.php
- Loading branch information
Showing
10 changed files
with
130 additions
and
40 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,72 @@ | ||
<?php | ||
//Definisco la lunghezza massima excerpt | ||
function custom_excerpt_length( $length ) { | ||
if ( is_home() || is_front_page() ){ | ||
return 30;} | ||
else{ | ||
return 50; | ||
} | ||
} | ||
add_filter( 'excerpt_length', 'custom_excerpt_length', 20 ); | ||
|
||
function new_excerpt_more( $more ) { | ||
if ( is_home() || is_front_page() ){ | ||
return '';} | ||
else{ | ||
return ' <a href="'. get_permalink() . '">... Continua a leggere</a>'; | ||
<?php | ||
/** | ||
* New function to set excerpt lenght and show "more link" | ||
* @link http://stackoverflow.com/questions/10081129/why-cant-i-override-wps-excerpt-more-filter-via-my-child-theme-functions | ||
* | ||
* Codex link: | ||
* @link http://codex.wordpress.org/Excerpt | ||
* @link http://codex.wordpress.org/Customizing_the_Read_More | ||
*/ | ||
|
||
add_action( 'after_setup_theme', 'italystrap_excerpt_more_lenght' ); | ||
|
||
if ( !function_exists( 'italystrap_excerpt_more_lenght' ) ): | ||
|
||
function italystrap_excerpt_more_lenght() { | ||
|
||
// Escerpt read more link function | ||
function italystrap_read_more_link() { | ||
|
||
return $read_more_link = ' <a href="'. get_permalink() . '">... ' . __( 'Read more', 'ItalyStrap' ) . '</a>'; | ||
|
||
} | ||
// Function to override | ||
function italystrap_custom_excerpt_more( $output ) { | ||
|
||
if ( has_excerpt() && !is_attachment() ) { | ||
$output .= italystrap_read_more_link(); | ||
} | ||
return $output; | ||
|
||
} | ||
|
||
add_filter( 'get_the_excerpt', 'italystrap_custom_excerpt_more' ); | ||
add_filter( 'excerpt_more', 'italystrap_read_more_link' ); | ||
|
||
// Excerpt lenght function | ||
function italystrap_excerpt_length( $length ) { | ||
|
||
if ( is_home() || is_front_page() ) { | ||
return 25; | ||
}else{ | ||
return 50; | ||
} | ||
} | ||
add_filter( 'excerpt_length', 'italystrap_excerpt_length' ); | ||
|
||
} | ||
} | ||
add_filter('excerpt_more', 'new_excerpt_more'); | ||
endif; // italystrap_excerpt_more_lenght | ||
|
||
|
||
/** | ||
* Function deprecated | ||
* | ||
*/ | ||
// function custom_excerpt_length( $length ) { | ||
// if ( is_home() || is_front_page() ){ | ||
// return 30;} | ||
// else{ | ||
// return 50; | ||
// } | ||
// } | ||
// add_filter( 'excerpt_length', 'custom_excerpt_length', 20 ); | ||
|
||
// function new_excerpt_more( $more ) { | ||
// if ( is_home() || is_front_page() ){ | ||
// return '';} | ||
// else{ | ||
// return ' <a href="'. get_permalink() . '">... Continua a leggere</a>'; | ||
// } | ||
// } | ||
// add_filter('excerpt_more', 'new_excerpt_more'); | ||
?> |
This file contains 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
This file contains 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
This file contains 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
This file contains 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