-
AuthorPosts
-
April 11, 2018 at 1:47 pm #940494
Hello together,
I have a problem and can’t solve it.
I’ve created a simple page and put there “blog posts” from Avia Builder + set the sidebar visible. Everything’s good.
But when I click now on a category I will be directed to the archive, where all blog posts are visible in full length,
Questions:
– Is it possible to shorten the words. For example the first 30 words should be displayed?
– Is it possible to show the blog post image?
alternative can I disable the archive and show a regular category?I hope you can understand me. :-)
Thank you
April 12, 2018 at 11:49 am #940867First question is solved. I just put in every blog post a “read more” tag. WordPress shortened automatically on archive category pages.
But I need help with my second questions: displaying a picture on archive category.
Thank you.
April 13, 2018 at 10:46 am #941398Hi,
Thank you for using Enfold.
The featured image should display on the category or archive pages by default. Please provide the login details in the private field so that we can check one of the posts.
Best regards,
IsmaelApril 13, 2018 at 10:51 am #941400Hello Ismael,
Thank you. Here we go:
April 14, 2018 at 12:09 pm #941886Hi DeltaSierra360,
Here are some threads to consider:
And this is how to add an image to a category
https://wordpress.stackexchange.com/questions/255559/how-to-add-featured-image-for-category-without-a-pluginIf you need further assistance please let us know.
Best regards,
VictoriaApril 14, 2018 at 1:13 pm #941906Hello, it seems you don’t understand me.
I have blog posts with images. When you visit the blog section you see the image and underneath the title with the text.
Once you go to a specific category you just see the headlines and text, but no image.
All I want is to display the pictures, which are already in every single blog post. I don’t want to set a category picture.
Thank you.
April 14, 2018 at 4:48 pm #941978Hi DeltaSierra360,
For that you need to modify the category page layout. It can be done by the code from this thread
Here are some threads to consider:
https://kriesi.at/support/topic/how-to-customize-layout-of-archive-pages/#post-357286Just use
if($context == 'archive') $layout = 'single-big';
If you need further assistance please let us know.
Just use a
Best regards,
VictoriaApril 14, 2018 at 9:50 pm #942050Sorry, that doesn’t work. I’ve put following code in my childtheme function:
add_filter('avf_blog_style','avia_change_category_blog_layout', 10, 2); function avia_change_category_blog_layout($layout, $context){ if($context == 'archive') $layout = 'single-big'; return $layout; }
But I only get this displayed above the header:
add_filter('avf_blog_style','avia_change_category_blog_layout', 10, 2); function avia_change_category_blog_layout($layout, $context){ if($context == 'archive') $layout = 'single-big'; return $layout; }
April 14, 2018 at 10:18 pm #942056Hi,
I have tested this code on my localhost, and it adds the post images from the default editor to the archive pages.//change category page layout to blog single small style add_filter('avf_blog_style','avia_change_category_blog_layout', 10, 2); function avia_change_category_blog_layout($layout, $context){ if($context == 'archive') $layout = 'single-big'; return $layout; }
Although I couldn’t add the code to your site because I got this error:
It was not possible to communicate with the website to check for fatal errors, so the PHP change was undone. You will need to upload your modified PHP file by other means, such as SFTP.
Please try to do so with ftp, or include ftp access in the Private Content area.
Best regards,
MikeApril 15, 2018 at 12:36 pm #942181Hello Mike,
Thank you, that works! But only when I put it in the functions.php of the theme. I am using a child theme and don’t want to put that after every update. Is der a possibility to put that in childs functions.php?
Yes, you can’t change things in wordpress code-editor. That’s because of my wordpress firewall. :-)
April 15, 2018 at 3:27 pm #942219Hi,
I tried disabling your firewall, but I was still unable to edit the functions.php
The reason your functions.php for your child theme is not working, is because it is missing the opening <?php
please add this and your function to your child theme functions.php:<?php /* * Add your own functions here. You can also copy some of the theme functions into this file. * WordPress will use those functions instead of the original functions then. */
Best regards,
MikeApril 15, 2018 at 4:45 pm #942238Awesome! Now it works very good.
Thank you so much for assistance.Topic can be closed. :-)
April 15, 2018 at 7:00 pm #942254Hi,
Glad we were able to help, we will close this now. Thank you for using Enfold.For your information, you can take a look at Enfold documentation here
and the video tutorials here
And if there are features that you wish Enfold had, you can request them and vote the requested ones here
For any other questions or issues, feel free to start new threads under Enfold sub forum and we will gladly try to help you :)Best regards,
Mike -
AuthorPosts
- The topic ‘Preview / Shorten blog posts in archive / category’ is closed to new replies.