Viewing 30 posts - 1 through 30 (of 42 total)
  • Author
    Posts
  • #311377

    Hey there,

    I would like to add a “Read More” or “Continue Reading” link to the end of my magazine posts’ excerpts. Is this possible?

    Thanks!

    #311683

    Hey Ti7V!

    Thank you for using Enfold.

    The excerpt for small magazine entries is hidden by default because there’s not enough space to accommodate them. If you really want to display it, you can edit config-templatebuilder > avia-shortcodes > magazine.php, find this code on line 558:

    if(empty($this->atts['thumbnails']))
    				{
    					 $image = "";
    					 $extraClass = "av-magazine-no-thumb";
    				}	

    Below, add this:

    `$excerpt = !empty($entry->post_excerpt) ? $entry->post_excerpt : avia_backend_truncate($entry->post_content, apply_filters( ‘avf_magazine_excerpt_length’ , 10) , apply_filters( ‘avf_magazine_excerpt_delimiter’ , ” “), “…”, true, ”);
    }`

    Regards,
    Ismael

    #312550

    How would I successfully recreate this using a child theme?

    Would I add magazine.php to ‘enfold-child’, then just add this new code below <?php?

    Or must I use both of the codes you provided above? Or do I copy the entire magazine.php to ‘efnold-child’? I tried this with functions.php using the live preview and received a fatal error message.

    Please excuse me, for I am new to this and just learning how to use the child theme.

    Thanks!

    #312552

    Also, is there any way to adjust the position of the ‘Read more’ link?

    #312936

    Hey!

    Please copy magazine.php file inside config-templatebuilder > avia-shortcodes in your child theme and then add following code to Functions.php file of your child theme in Appearance > Editor

    require_once( 'config-templatebuilder/avia-shortcodes/magazine.php' );

    Please add following code to Quick CSS in Enfold theme options under General Styling tab

    .read-more-link { text-align: center; }

    Cheers!
    Yigit

    #313037

    Ok, Yigit.

    Do I need to include:

    global $avia_config; $avia_config[‘use_child_theme_functions_only’] = true;

    ? Or is that not recommended?

    Cheers!

    #313065

    When I use the config function in my child theme, I get a fatal error message.

    Right now, I have nothing but <?php in my child functions.php. What do I need to have in there so that is corresponds with the parent?

    #313108

    Also, is there a way to position the ‘Read more’ link immediately following the excerpt content?

    #314234

    Hi!

    Try modifying the line 577 instead of adding another one below it, line should be like this 577:

    if($excerpt)$output .=		"<div class='av-magazine-content entry-content' {$markupContent}>{$excerpt}<a href='".get_permalink($entry->ID)."' class='more-link'>".__('Read more','avia_framework')."<span class='more-link-arrow'>&rarr;</span></a></div>";
    

    Regarding putting modified shortcodes in your child theme, refer to this article:
    http://kriesi.at/documentation/enfold/add-new-or-replace-advanced-layout-builder-elements-from-child-theme/

    Cheers!
    Josue

    #370114

    Hi.
    Your previous feedback was a big help to me.
    I am using the magazine element, with the main story being the larger story above the others.
    But the others still do not have an excerpt below them.
    Any way I can get this?
    Thanks in advance.

    Darran

    #370279

    Hey!


    @darranreadman
    : Can you please provide a link to the page with the magazine element? We would like to check it.

    Cheers!
    Ismael

    #379131

    I’m having the same issue… I’ve done the things Ismael recomended, and all I’ve got is a “Read More” below every post… Still no Excerpt, except on the “first_big” one.

    So, adding this:

    			$output .=		"<div class='read-more-link'><a href='".get_permalink($entry->ID)."' class='more-link'>".__('Read more','avia_framework')."<span class='more-link-arrow'>&rarr;</span></a></div>";
    

    After this:

    if($excerpt)$output .=		"<div class='av-magazine-content entry-content' {$markupContent}>{$excerpt}</div>";
    

    Will only show us “Read More”, not excerpts.

    #379608

    Hi @scaico,

    Can you post the link to your website please? a temporary admin account would be helpful too.

    Regards,
    Josue

    #385031

    This addition to the Functions.php breaks the theme:

    require_once( ‘config-templatebuilder/avia-shortcodes/magazine.php’ );

    My complete Functions.php in child theme is (without the dividers):

    ——————————
    <?php

    function remove_avia_search(){
    remove_filter( ‘wp_nav_menu_items’, ‘avia_append_search_nav’, 10, 2 );
    }
    add_action( ‘init’ , ‘remove_avia_search’ );

    add_theme_support(‘avia_template_builder_custom_css’);

    add_filter(‘avf_logo_subtext’, ‘kriesi_logo_addition’);

    function kriesi_logo_addition($sub) {
    $sub .= “Celebrating 30 years of protection and conservation<br />of the majestic American Bald Eagle!”;
    return $sub;
    }

    require_once( ‘config-templatebuilder/avia-shortcodes/magazine.php’ );

    ——————————

    I’m using enfold 3.0.5 and the edit to the magazine.php code is actually on line 587. Editing that line with your code does nothing.

    • This reply was modified 9 years, 9 months ago by scarlettr8.
    #385997

    Hey!

    Refer to this article on how to embed a modified ALB element via child theme:
    http://kriesi.at/documentation/enfold/add-new-or-replace-advanced-layout-builder-elements-from-child-theme/

    Cheers!
    Josue

    #424148

    Hi!
    same problem: changing / adding the code at line 577 still only shows “Read More”, but not the content of the excerpt itself.

    I think because above in the magazine.php the $excerpt is not defined
    $excerpt = "";
    and some lines below, if ($style == ‘small’) it will remain empty.

    Right? Any solution? (’cause I’m not the greatest coder and wont’t play domino… :-)

    Cheers,
    Yeti

    #424168

    Hey @Yeti!

    Do you have an excerpt defined in each Post?

    Best regards,
    Josue

    #424213

    Hi Josue!

    Yes. And in my case it concerns to the portfolio entries. For the > Layout Builder > Content Elements > Magazine > Portfolio entries an option to show their excerpts would be more than nice. For all and not only for the first/top shown bigger. But for them, the ($style == ‘small’) will remain empty I think.

    All the best,
    Yeti

    #424232

    Can you please create us a WordPress administrator account? post it here as a private reply.

    Regards,
    Josue

    #428784
    This reply has been marked as private.
    #429120

    Hey!

    I didn’t note a magazine.php in your child theme, have you already did this step?

    Cheers!
    Josue

    #429584

    Hey,
    for first I wanted to try it in the original magazin.php at
    [wordpress-path]/ourcontent/themes/enfold/config-templatebuilder/avia-shortcodes
    and only if it works, I wanted to put it in the child theme.

    And yes, I already tried that step, but it has no effect – no excerpts are pulled and shown.
    Even when I change the “if($excerpt)$output” to “$output”, it shows only the Read more link but no excerpt.

    All the best
    Yeti

    #429843

    Hi,

    Can you please create me a temporary FTP account? post it here as a private reply.

    Regards,
    Josue

    #429914
    This reply has been marked as private.
    #429920
    This reply has been marked as private.
    #429968

    Check it, i modified magazine.php on your child theme.

    Best regards,
    Josue

    #430231

    Hi Josue,
    thanks for your work. But the new magazine.php doesn’t pull the excerpt out of the portfolio post – now there is only a standard text issued: “This is a Page excerpt. It will be displayed for search results”.

    This is more confusing, because in the footer in the first widget on the left under “Produkt-News”, there are the same three portfolio posts – with their excerpts.

    Best regards,
    Yeti

    #430645

    Yeah i noted that. Check it now please.

    Cheers!
    Josue

    #431546

    Yeah! Thanx a lot, Josue. Works perfectly.

    Greets,
    Yeti

    #431674

    You are welcome, glad to help :)

    Regards,
    Josue

Viewing 30 posts - 1 through 30 (of 42 total)
  • You must be logged in to reply to this topic.