Reading more and photo for the last article section
-
I am just going mad!
I love this theme but is i cant add the reading more in one article ( i can add it but is impossible to view on the article)I tried with everything but i cant!
I want the link to direct to the permalink of the article!
Second question: Where should i add the photos to be visible on the home page?
-
Hi,
Are you using a child theme? I can guide you through this process.
And you need to set your image as the Featured Image of the post. 🙂
Regards,
HardeepI Created by myself a child theme but it was useless.
i created a folder in wp-content/themes/zerif-lite-child.i insert a styles.css file with this code inside:
/* Theme Name: Zerif Lite Child Theme URI: http://albanesibrescia.it/Prova1/twenty-fifteen-child/ Description: Zerif Lite Child Theme Author: Alban Muzaka Author URI: http://albanesibrescia.it/Prova1 Template: zerif-lite Version: 1.0.0 License: GNU General Public License v2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html Tags: light, dark, two-columns, right-sidebar, responsive-layout, accessibility-ready Text Domain: zerif-lite-child */
and then i just added a functions.php file with this code:
<?php function custom_excerpt_length( $length ) { return 30; } add_filter( 'excerpt_length', 'custom_excerpt_length', 999 ); function new_zerif_excerpt_more( $more ) { return ' <a class="read-more" href="'. get_permalink( get_the_ID() ) . '">' . __('... continua a leggere <span class="meta-nav">→</span>', 'zerif-lite') . '</a>'; } add_filter('excerpt_more', 'new_zerif_excerpt_more'); function my_undo_hooks( $more ) { remove_filter('excerpt_more', 'zerif_excerpt_more' ); } add_action( 'after_setup_theme', 'my_undo_hooks' );
dont know what to do next and if the code is ok or not
maybe the functions.php is completly wrong! but i dont know! Do i have to add something else in the code at the functions.php file?
Hey Hardeep,
can you please help me?
Someone can help me? Once i create a child theme do i have to activate it? if i activate it is only a disaster!Thanks
Hi,
Why don’t you edit the latest_news.php file instead and add a custom link below the_except tag? 🙂
Regards,
HardeepCan you please tell me how to do it?
The theme is fantastic but all i want more is this:Hardeep is there a solution for my request?
Hi,
You can use the following code below the_excerpt(); tag in big_title.php file:
<?php echo '<a class="read-more" href="'. get_permalink( get_the_ID() ) . '">' . __('... continua a leggere <span class="meta-nav">→</span>', 'zerif-lite') . '</a>'; ?>
Regards,
HardeepHello Hardeep,
First thank you very much for your help but
I dont have that function!
This is the big.title.php code on zerif-lite/section folder<?php echo '<div class="container">'; $zerif_bigtitle_title = get_theme_mod('zerif_bigtitle_title',__('To add a title here please go to Customizer','zerif-lite')); if( !empty($zerif_bigtitle_title) ): echo '<h1 class="intro-text">'.__($zerif_bigtitle_title,'zerif-lite').'</h1>'; endif; $zerif_bigtitle_redbutton_label = get_theme_mod('zerif_bigtitle_redbutton_label',__('One button','zerif-lite')); $zerif_bigtitle_redbutton_url = get_theme_mod('zerif_bigtitle_redbutton_url','#'); $zerif_bigtitle_greenbutton_label = get_theme_mod('zerif_bigtitle_greenbutton_label',__('Another button','zerif-lite')); $zerif_bigtitle_greenbutton_url = get_theme_mod('zerif_bigtitle_greenbutton_url','#'); if( (!empty($zerif_bigtitle_redbutton_label) && !empty($zerif_bigtitle_redbutton_url)) || (!empty($zerif_bigtitle_greenbutton_label) && !empty($zerif_bigtitle_greenbutton_url))): echo '<div class="buttons">'; if ( !empty($zerif_bigtitle_redbutton_label) && !empty($zerif_bigtitle_redbutton_url) ): echo '<a href="'.$zerif_bigtitle_redbutton_url.'" class="btn btn-primary custom-button red-btn">'.__($zerif_bigtitle_redbutton_label,'zerif-lite').'</a>'; endif; if ( !empty($zerif_bigtitle_greenbutton_label) && !empty($zerif_bigtitle_greenbutton_url) ): echo '<a href="'.$zerif_bigtitle_greenbutton_url.'" class="btn btn-primary custom-button green-btn">'.__($zerif_bigtitle_greenbutton_label,'zerif-lite').'</a>'; endif; echo '</div>'; endif; echo '</div>'; echo '<div class="clear"></div>'; ?>
Hello Hardeep,
any idea?
Thanks a lotHi,
Sorry but I meant latest_news.php, not the big_title.php. I apologize for wasting your time. Sorry. 🙂
Regards,
HardeepHello Hardeep,
Your solution was ok, i did it but it was not complete!
As i mentioned you i wanted the same thing in the singele page like i show you in the picture.I did it even with child theme (you can download the child theme) the same thing but it was uncomplete like yours!
I want in the latest news section the reading more option after ex. 50 characters, the same thing if someone is going in the project menu should see all the articles with the same visulization and reading more option after 50 charachters. Should be like this:
Thank you very much for your help
Albi
Hi,
Then you need to edit https://github.com/Codeinwp/zerif-pro/blob/production/template-blog.php file, too.
However, below this:
get_template_part( 'content', get_post_format() );
will go:
echo '<a class="read-more" href="'. get_permalink( get_the_ID() ) . '">' . __('... continua a leggere <span class="meta-nav">→</span>', 'zerif-lite') . '</a>';
Regards,
HardeepHello Hardeep,
I change the template-blog.php like you suggestioned but nothing happens!
Maybe because they are not blog templates but they are category. Is not problem! All i need is that in the last news section on home page the article is not long more than 50 charac. but is at long as the article itself!
Is ugly!Thank you!
BRHi,
That is the blog template. Here’s a thing, visit my website hardeepasrani.com and contact me via email or visit our website themeisle.com and we will do this for you. 🙂
Regards,
Hardeep
- The topic ‘Reading more and photo for the last article section’ is closed to new replies.