-
AuthorPosts
-
August 30, 2017 at 2:51 pm #845819
Hi there,
Thanks again to the team for building such a fantastic theme!
I’m using the Magazine Content Element on the homepage of a new website I’m working on (details in private comments), but would like to add a couple of things to the post feed if possible;
Instead of just having the date above the post title, I’d like the date above the post title, above the categories (which link to the categories) and an excerpt of the first 150 characters of the post followed by ‘…’ and so that it looks like;
30TH AUGUST 2017
This is the title of the blog post
Posted in: News | Technology
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut suscipit, lectus ut eleifend rutrum, quam metus condimentum massa, ut volpat lorem massa…I’ve been reading some of the forum posts but can’t find what changes I’d need to make to the magazine.php file to achieve the above so was hoping you could help please?
Thanks,
Sam
- This topic was modified 7 years, 2 months ago by sjwmobile.
September 3, 2017 at 10:51 am #847357Can someone please get back to me on the above ASAP?
- This reply was modified 7 years, 2 months ago by sjwmobile.
September 4, 2017 at 7:02 am #847528Hi,
Thank you for using Enfold.
Please refer to this link for the “excerpt” modification.
// https://kriesi.at/support/topic/date-author-and-excerpt-in-magazine-element/
In the same shortcode file, you should be able to relocate the date.
Best regards,
IsmaelSeptember 4, 2017 at 9:50 am #847625Thanks. What about adding the category though?
Also, is there any way to add some vertical spacing between the news posts? They look a little crushed (see private content for URL / login). Ideally I’d like to add 10-20px padding directly underneath the excerpt?
Finally, is there a way I can add a ‘Read More’ link directly beneath the excerpt (before the padding) to link to the full article?Thanks for your help,
Sam- This reply was modified 7 years, 2 months ago by sjwmobile.
September 4, 2017 at 10:10 am #847631Comments merged into second comment.
- This reply was modified 7 years, 2 months ago by sjwmobile.
September 7, 2017 at 2:41 am #848904Hi,
I’m sorry for the late response.
Please add this code below the “author” modification to create the category.
$taxonomies = get_object_taxonomies(get_post_type($entry->ID)); $cats = ''; $excluded_taxonomies = array_merge( get_taxonomies( array( 'public' => false ) ), array('post_tag','post_format') ); $excluded_taxonomies = apply_filters('avf_exclude_taxonomies', $excluded_taxonomies, get_post_type($entry->ID), $entry->ID); if(!empty($taxonomies)) { foreach($taxonomies as $taxonomy) { if(!in_array($taxonomy, $excluded_taxonomies)) { $cats .= get_the_term_list($entry->ID, $taxonomy, '', ', ','').' '; } } }
After that, look for this code around line 690:
$output .= $separator.$author_output;
Below, add this code:
$output .= "<div class='av-magazine-cat'>"; $output .= $cats; $output .= "</div>";
For the read more link, please look at this reply on the same thread.
// https://kriesi.at/support/topic/date-author-and-excerpt-in-magazine-element/#post-843817
Best regards,
IsmaelSeptember 7, 2017 at 10:23 pm #849287Thanks Ismael, but I can’t see where the ‘read more’ code is on that thread?
Also, I’ve managed to add the categories… but how do I add ‘Posted in’ before the category names please?
Thanks,Sam
September 7, 2017 at 11:29 pm #849323Also, can you please answer the spacing question please? Take a look at the homepage of my site (details in private message) to see what I mean please…
September 8, 2017 at 8:54 am #849485Hi,
1.) I’m sorry. I provided the wrong link. Please read through the post.
// https://kriesi.at/support/topic/magazine-excerpt-2/#post-846765
2.) Insert the “Posted in” text right on this line:
$output .= $cats;
3.) Add this css code to create more space between the entries.
.av-magazine-content-wrap { padding-bottom: 20px; } .av-magazine-entry { margin-bottom: 50px; /* padding: 0 0 50px 0; */ }
Adjust the values as needed.
Best regards,
IsmaelSeptember 10, 2017 at 11:40 am #850099Thanks Ismael.
The CSS worked great and I’ve decided not to use the read more link (eats up page space) but thank you for advising.
I couldn’t work out how to add ‘Posted in’ to the line of PHP in magazine.php – every time I edited the file, it broke the site entirely so I had to revert back. Could you perhaps advise the exact code I need to use please?
Also, I tried to adjust the width/height of the thumbnail image for the magazine element (using CSS I found from one of your colleagues in the forum);
.av-magazine-thumbnail img, .av-magazine-thumbnail {
width: 100px !important;
height: 80px !important;
}However, the border around the thumbnail breaks when you do this – see my website homepage (details in private) to see what I mean – the border around the base of the thumbnail needs increasing… can you advise please?
Thanks,
Sam
September 11, 2017 at 2:26 pm #850512Hi Sam,
I don’t see the thumbs any more, have you removed them? How did you try to add the text? The single quotes on the screenshot below will break things, you need to replace them with the regular ones.
this ‘ and ’ to ' and '
Best regards,
Victoria- This reply was modified 7 years, 2 months ago by Victoria.
September 11, 2017 at 2:33 pm #850520Apologies, I made the changes to a different URL – see private (forgot to update you) – you should be able to see the thumbnail issue on that URL.
Can you advise the line of code that I should use that won’t break the php file?
Should it be as follows?$output .= 'Posted in' $cats;
Thanks,
Sam
September 12, 2017 at 8:16 am #850841Hi,
Please replace the code with:
$output .= 'Posted in: ' . $cats;
For the border issue, please replace the css code with the following.
.av-magazine-thumbnail { width: 120px; height: 80px; } .av-magazine-thumbnail a { width: 100%; height: 100%; } .av-magazine-thumbnail img { width: 100%; height: 100%; }
You may find the thumbnails distorted so you have to adjust the default size of the Settings > Media > Thumbnail image. Save then regenerate the images.
// https://wordpress.org/plugins/force-regenerate-thumbnails/
Best regards,
IsmaelSeptember 12, 2017 at 9:58 am #850920Thanks Ismael – both worked perfectly!
Sam
September 12, 2017 at 7:00 pm #851182Hi Sam,
Glad that Ismael helped you. Thanks for using Enfold :)
Best regards,
Nikko -
AuthorPosts
- You must be logged in to reply to this topic.