Tagged: button, excerpts, read more button, read more link
-
AuthorPosts
-
December 13, 2017 at 3:53 pm #888392
Hello Guys,
iam using the great Enfold Theme and have two important questions to make my Website more proffessional.
1. On my front Page iam using the Blogpost style or Builder and have changed the read more Link to a Button, which is called “Jetzt zum Angebot”. This button i want to use, when i have a good Deal on my Site. But i have articels with only informations and so the Button wich ist called ” Jetzt zum Angebot” make no sins. When i have articles with information the Button have to show another text like “jetzt zum Ratgeber” or “jetzt zum Artikel”.
Is it possible to change this read more link individual, so that it makes sin for my users?2. Iam using the excerpts as you can see on my homepage. The read more Button is attached to the lengh of the excerpts, so that he ist not on the same level, like an other read more button. (You can see it on my frontpage).
Is there a Code or something, that can make the button fix, so that a diffrent lenght of the excerpts is not important any more? Maybe a breakline Code beetween excerpts and read more button/link?I hope you understand my Questions. I do not speak english so much.
In the private Content, i will fill in the Homepage url and than you will see what i mean.Thanks for your time!
Nice regards
Steps 3011December 18, 2017 at 11:18 am #889966Hey steps3011,
Thank ypu for using our theme.
To change the read more text you can use filters and you find the necessary info at
https://codex.wordpress.org/Customizing_the_Read_MoreCheck, if this helps you.
Best regards,
GünterJanuary 2, 2018 at 2:57 pm #892491Hey Günter,
sorry for my late answer and a happy new Year.I didn`t get it, because i use the excerpts and i have already changed the read more button and just need an individual Text for different type of posts. Is it possible to do this, when im using the excerpts or is it just possible with the read more tag to make it individual? Iam sorry, but i didn’t understand how to do it, even when im reading the information in the link you sent me in your answer.
I have a other question which is very important to me.
On my homepage http://www.technikolymp.de i’m using the blog grid layout with 3 columns. I have different articels on my website with hot deals and articels with only informations. Is it possible to change the sizes of the images in this blog layout? Example:
3 Images are 450 x 400 in a three column grid with blog layout. Now i release a new information article and the image should be the same size as the three images below. Like its just one grid. And above this article there are 3 images with 450 x 400 px. Is this possible with the blog layout?
I hope that you understand my question, because my english isn’t very good.
Nice Greeds
Steps3011
January 4, 2018 at 5:15 am #893080Hi,
1.) What do you mean by “an individual Text for different type of posts”? Would you like to define the excerpt manually? Please edit the the post then enable the Excerpt module from the Screen Options panel.
2.) Are you using the Blog Posts element? You can set the “Preview Image Size” settings to manual or the second option and then define the thumbnail size.
Best regards,
IsmaelJanuary 6, 2018 at 4:24 pm #894112Hello Ismael,
I have an example for you, in this page there is a difference between a Deal and a practical adviser tile. The Buttons have different designations. And also the Size of the tiles are different. How can i manage it like this on my site?1. Different designations of the Read more Buttons.
2. Different Sizes of The tiles/ Images for diffent Type of Categories in my Website (deals vs. Practical Adviser)Best regards
Steps3011January 7, 2018 at 8:17 pm #894453Hi steps3011,
Unfortunately, it would require quite some time and customization of the theme to achieve this, so I am sorry to tell you that this is not covered by our support. However, if it’s really important for you to get this done, you can always hire a freelancer to do the job for you :)
Best regards,
VictoriaJanuary 11, 2018 at 2:54 pm #896174Hey Victoria,
1.Different designations of the Read more ButtonsOn another topic from another user i saw this:
https://kriesi.at/support/topic/customize-read-more-buttons/Is it possible to do this in this way? I tried, but i failed, because i didnt find the row in my archive.php. So it didnt works.
2. Different Sizes of The tiles/ Images for diffent Type of Categories in my Website (deals vs. Practical Adviser)
I thought there is a code or something in the index oder function.php, thats breaks the pattern of the blog layout on the frontpage, like:
if post id:14, make image size on frontpage 1200 x 400 px.
Best regards
Steps 3011January 13, 2018 at 3:58 am #896788Hi,
Are “deal” and “practical adviser” categories?
I’m sorry but I’m having a little bit of difficulty understanding the request. If you don’t mind, we would like to see a screenshot or a mockup of the layout that you have in mind so that we can understand it better. You can use imgur or dropbox.
1.) You can find the read more markup in the loop-index.php file.
$current_post['content'] = $blog_content == "content" ? get_the_content(__('Read more','avia_framework').'<span class="more-link-arrow"></span>') : get_the_excerpt(); $current_post['content'] = $blog_content == "excerpt_read_more" ? $current_post['content'].' <div class="read-more-link"><a href="'.get_permalink().'" class="more-link">'.__('Read more','avia_framework').'<span class="more-link-arrow"></span></a></div> ' : $current_post['content']; $current_post['before_content'] = "";
If “deal” and “pracitcal adviser” are categories, you can use the has_category conditional function to alter the text of the read more button based on the current post category.
// https://codex.wordpress.org/Function_Reference/has_category
2.) Unfortunately, this feature will require major modification on the the theme. Please hire a freelance developer as previously suggested.
Best regards,
IsmaelJanuary 15, 2018 at 7:56 pm #897688Hey Guys,
In the link below you can see a picture with two different articles from two different categories, but the same label of the Read more button “Now for sale”. On the left is a so-called deal from the category “consumer electronics”. On the right side you can see an article from the category “Technik-Magazin” and also there the “read more button” is labeled with “Now for sale”. And I would like to have all articles from the categories “Technology Magazine and Lexicon” labeled “Continue to Article” and not “Now for sale”.
I tried using the custom fields with WordPress, but it did not work.
Best Regards
Steps 3011
January 16, 2018 at 2:44 am #897811Hi,
Thank you for the info. Please try the suggestion above. Use the “has_category” function to define a different read more text for each category.
Best regards,
IsmaelJanuary 16, 2018 at 8:27 pm #898152Hello,
I looked at the link with has_category, but I do not understand it. Could you possibly give an example for my category: Encyclopedia?
In which file do I write something to use a text for each category?
I think so, then I grab that too.Best regards
Steps3011January 17, 2018 at 7:57 am #898324Hi,
You can try the following modifications.
if( has_category('name-of-category-here') ) { $readmore = __('New read more text','avia_framework'); } elseif ( has_category('another-name-of-category') ) { $readmore = __('Another read more text','avia_framework'); } else { $readmore = __('Read more','avia_framework'); } $current_post['content'] = $blog_content == "content" ? get_the_content($readmore.'<span class="more-link-arrow"></span>') : get_the_excerpt(); $current_post['content'] = $blog_content == "excerpt_read_more" ? $current_post['content'].' <div class="read-more-link"><a href="'.get_permalink().'" class="more-link">'.$readmore.'<span class="more-link-arrow"></span></a></div> ' : $current_post['content']; $current_post['before_content'] = "";
Adjust the values of the has_category function and the designated readmore text.
Best regards,
IsmaelJanuary 17, 2018 at 4:16 pm #898508Hello,
thank you for the Code. I just have to know in wich template i have to put this code. In the Function or the Category-template?
I put the code in the category-template, but it diddnt takes an effect. I send you the image in the private content.Thanks
With Best Regards
Steps3011- This reply was modified 6 years, 10 months ago by steps3011.
January 20, 2018 at 3:32 am #899946Hi,
The code is located in the includes > loop-index.php file. Please review our previous response.
// https://kriesi.at/support/topic/individual-read-more-button/#post-896788
Best regards,
IsmaelJanuary 21, 2018 at 8:40 pm #900452Hello,
I have now tried a little and found out, that he translates the code as soon as I choose blog layout settings: use advance layout … Then he takes over the code and changes the read more text in the name i have chosen for the categorys. (Thanks for the code)Unfortunately, this is not true for the grid layout and not for the home page.
Do you have a suggestion as he also on the start page and the selected categories in the grid layout takes over?
- This reply was modified 6 years, 10 months ago by steps3011.
January 22, 2018 at 4:22 am #900546Hi,
Thank you for the update.
For the grid layout, you will have to modify the config-templatebuilder > avia-shortcodes > postslider.php file. Look for this code around line 451.
$permalink = ' <div class="read-more-link"><a href="'.get_permalink($the_id).'" class="more-link">'.__('Read more','avia_framework').'<span class="more-link-arrow"></span></a></div> ';
You can do the same modification.
if( has_category('name-of-category-here') ) { $readmore = __('New read more text','avia_framework'); } elseif ( has_category('another-name-of-category') ) { $readmore = __('Another read more text','avia_framework'); } else { $readmore = __('Read more','avia_framework'); } $permalink = ' <div class="read-more-link"><a href="'.get_permalink($the_id).'" class="more-link">'.$readmore.'<span class="more-link-arrow"></span></a></div> ';
Best regards,
IsmaelJanuary 22, 2018 at 10:42 am #900729Hello Ismael,
that worked with the code for the grid layout. (Thanks a lot)
Now there is only one more thing that does not work.Unfortunately, he does not use this if has_category function for the start page to differentiate the categories. There I will continue to see the same read more texts for each category. That’s the only thing missing, then it would be done.
Is there a folder where can I apply the homepage as well? That would be exactly how it should be in the end.
Best regards
Steps3011
January 23, 2018 at 5:45 am #901163Hi,
Please post the login details in the private field so that we can check the page. Is that a content slider?
Best regards,
IsmaelJanuary 23, 2018 at 10:53 am #901348Hello,
So I use on the start page, the grid layout with 3 columns and as an ad the blog posts. I’m not sure what you meant with content slider. I’ll send you my access data in the private field.
Thanks for your help.
Best regards
Steps 3011
January 24, 2018 at 3:40 am #901847Hi,
Unfortunately, he does not use this if has_category function for the start page to differentiate the categories. There I will continue to see the same read more texts for each category. That’s the only thing missing, then it would be done.
The same postslider.php modification should work in the home page because it’s using the blog posts element or the grid layout. Did you add more has_category conditional function? Please enable the Appearance > Editor panel so that we can check the modification.
Best regards,
IsmaelJanuary 24, 2018 at 12:22 pm #902095Hello Ismael,
I have activated the editor in the theme so you can check it.
I still have the Has_category function in the category-template.php packed. Have it just taken out just to see if something changes, but unfortunately unsuccessful. The function is now in the folder again, even if it does not have to be there.
Many thanks for the help
Best regards
Steps 3011
January 25, 2018 at 6:09 am #902575Hi,
We modified the code inside the postslider.php file.
if( has_category(array('technikmagazin', 'haushaltsgeraete', 'unterhaltungselektronik', 'lexikon')) ) { $readmore = __('Weiter zum Artikel','avia_framework'); } else { $readmore = __('Read more','avia_framework'); }
Add more category slug or name inside the has_category array if necessary.
Best regards,
IsmaelJanuary 25, 2018 at 12:20 pm #902780Hello Ismael,
unfortunately he still does not realize the difference between the categories on the start page. There is still always the same read more text displayed, no matter which category it is.
I still found the has_category in the loop-index and tried to insert it in the loop page. Unfortunately without effect. I’ll send you a picture maybe you can do something with it from the looppage.php
Hello Ishmael,
unfortunately he still does not realize the difference between the categories on the start page. There is still always the same read more text displayed, no matter which category it is.
I still found the has_category in the loop-index and tried to insert it in the loop page. Unfortunately without effect. I’ll send you a picture maybe you can do something with it from the looppage.php
I’ve thought that through this 2 x $ readmore things that maybe can not distinguish and always takes only one read more text on the start page.
Best regards
Steps3011
January 26, 2018 at 12:01 pm #903328Hi,
Which categories should have a different “read more” text? Did you define additional categories in the array?
if( has_category(array('technikmagazin', 'haushaltsgeraete', 'unterhaltungselektronik', 'lexikon')) ) {
Best regards,
IsmaelJanuary 26, 2018 at 2:32 pm #903394Hey Ismael,
the categories technical magazine and encyclopedia should have another read more text. I have also included this in the code, but the changes are indeed in the categories, but not on the home page.
if( has_category(array(‘technikmagazin’, ‘lexikon’)) ) {
Best regards
Steps3011
January 29, 2018 at 5:21 am #904017Hi,
Thank you for the info. We added the post id paramter of the has_category function. It should be working properly now.
Best regards,
IsmaelNovember 7, 2018 at 4:20 pm #1030895Hello Guys,
Yesterday i updated my enfold theme and now i have the problem, that the” has catetegory function” do not work on my homepage. I will copy you the last 2 messages from me and from ismael, he fixed the problem month ago.
Me: Hey Ismael,
the categories technical magazine and encyclopedia should have another read more text. I have also included this in the code, but the changes are indeed in the categories, but not on the home page.
if( has_category(array(‘technikmagazin’, ‘lexikon’)) ) {
Ismael:
Hi,Thank you for the info. We added the post id paramter of the has_category function. It should be working properly now.
And than it worked. But since i updated the theme yesterday the function works not on the Frontpage (Homepage).
Please, cann you help me, that the function even works on the homepage again.
With best regards
Steps3011
November 12, 2018 at 5:30 am #1032425 -
AuthorPosts
- The topic ‘Individual Read more Button’ is closed to new replies.