Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #477634

    Hello,

    I’d like to show under the left big image of the magazine module the summary done with the <!–more–> tag.
    The problem is that the linebreaks don’t appear.
    Then, i wrote :

    $test=get_post($entry->ID);
    $test = preg_split( '/<!--more(.*?)?-->/', $test->post_content );

    and replace

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

    Everything is ok except that the <p> and <br /> are not render.

    Could you help please ?

    Regards

    #478098

    Hello,

    No help ?

    Regards

    #478364

    Hello,

    2 days without response…

    Please help.

    Regards

    #478456

    Hey!

    Can you please create a temporary admin login and post it here privately? Please also include FTP access so we can look into it.
    P.S.: Our queue goes from the oldest queries to the newest ones. Each time you self post, you are pushing your query to the end of our queue. If your case is urgent, please try to avoid self posting :)

    Best regards,
    Yigit

    #478621

    Hello,
    Here you need.
    Thank you

    #480054

    Hey!

    We are very sorry for the delay. I tried to login to the site but the credentials above are not working. Where did you add the codes? On which lines?

    Best regards,
    Ismael

    #480097

    Hello Ismael,
    You can see in bold what i add and modify (in magazine.php).
    regards

    
    $markupEntry  	= avia_markup_helper(array('context' => 'entry','echo'=>false, 'id'=>$entry->ID, 'custom_markup'=>$this->atts['custom_markup']));
    			$markupTitle 	= avia_markup_helper(array('context' => 'entry_title','echo'=>false, 'id'=>$entry->ID, 'custom_markup'=>$this->atts['custom_markup']));
    			$markupContent 	= avia_markup_helper(array('context' => 'entry_content','echo'=>false, 'id'=>$entry->ID, 'custom_markup'=>$this->atts['custom_markup']));
    			$markupTime 	= avia_markup_helper(array('context' => 'entry_time','echo'=>false, 'id'=>$entry->ID, 'custom_markup'=>$this->atts['custom_markup']));
    			$format			= get_post_format($entry->ID) ? get_post_format($entry->ID) : 'standard';
    			$type			= get_post_type($entry->ID);
    			$icontype		= $type == 'post' ?  $format : $type;
    			$icon 			=  "<a href='{$link}' {$titleAttr} class='iconfont av-magazine-entry-icon' ".av_icon_string($icontype)."></a>";
    			$extraClass		= "";
    			<strong>$test=get_post($entry->ID);
                            $test = preg_split( '/<!--more(.*?)?-->/', $test->post_content );</strong>
    			
    			if($style == 'small')
    			{
    				if(empty($this->atts['thumbnails']))
    				{
    					 $image = "";
    					 $extraClass = "av-magazine-no-thumb";
    				}
    			}
    			else
    			{
    				$excerpt = !empty($entry->post_excerpt) ? $entry->post_excerpt : avia_backend_truncate($entry->post_content, apply_filters( 'avf_magazine_excerpt_length' , 60) , apply_filters( 'avf_magazine_excerpt_delimiter' , " "), "…", true, '');
    			}
    			
    					
    			
    			$output .= "<article class='hentry av-magazine-entry av-magazine-entry-id-".$entry->ID." av-magazine-format-{$format} av-magazine-type-{$type} av-magazine-entry-".$entry->loop." av-magazine-entry-".$style." {$extraClass}' {$markupEntry}>";
    			
    			if($this->atts['thumbnails'] || ($style == 'big' && $image))
    			{
    							$output .="<div class='av-magazine-thumbnail'>";
    				if($image)	$output .="<a href='{$link}' {$titleAttr} class='av-magazine-thumbnail-link '>{$image}</a>";
    				if(!$image)	$output .= $icon;
    							$output .="</div>";
    			}
    		
    			$output .= 		"<div class='av-magazine-content-wrap'>";
    			$output .=		"<header class='entry-content-header'>";
    			$output .=			"<time class='av-magazine-time updated' {$markupTime}>".$time."</time>";
    			$output .=			$separator.$author_output;
    			$output .=			"<{$titleTag} class='av-magazine-title entry-title' {$markupTitle}>{$title}</{$titleTag}>";
    			$output .= 		"</header>";
    if($excerpt)$output .=		"<div class='av-magazine-content entry-content' {$markupContent}>{<strong>$test[0]</strong>}</div>";
    			$output .= 		"</div>";
    			$output .= 		"<footer class='entry-footer'></footer>";
    			$output .= "</article>";
    			
    			return $output;
    
    #480099

    The bold don’t work.
    Line 10-11 i add :

    $test=get_post($entry->ID);
     $test = preg_split( '/<!--more(.*?)?-->/', $test->post_content );
    

    on the line :
    if($excerpt)$output .= "<div class='av-magazine-content entry-content' {$markupContent}>{$test[0]}</div>";
    $test[0] instead of $excerpt

    • This reply was modified 9 years, 5 months ago by hurraken.
    #480635

    Hi!

    Please remove the modifications above then look for this code:

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

    Below, add this code:

    $excerpt = !empty($entry->post_excerpt) ? $entry->post_excerpt : avia_backend_truncate($entry->post_content, apply_filters( 'avf_magazine_excerpt_length' , 60) , apply_filters( 'avf_magazine_excerpt_delimiter' , " "), "…", true, '');
    

    If you want to increase the excerpt length, use this in the functions.php file:

    add_filter('avf_magazine_excerpt_length','avf_magazine_excerpt_new_lenght', 10, 1);
    function avf_magazine_excerpt_new_lenght($excerpt) {
    $excerpt = 200;
    return $excerpt;
    }

    The br and p tags are remove because of the wpautop function which is a default feature of WordPress. https://codex.wordpress.org/Function_Reference/wpautop

    Best regards,
    Ismael

    #480640

    Hello Ismael,

    I ‘d like to use the <!–more–> tag no the excerpt.

    is it not possible ?

    Regards

    #481142

    Hi!

    You can replace this code:

    $excerpt = !empty($entry->post_excerpt) ? $entry->post_excerpt : avia_backend_truncate($entry->post_content, apply_filters( 'avf_magazine_excerpt_length' , 60) , apply_filters( 'avf_magazine_excerpt_delimiter' , " "), "…", true, '');
    

    with this:

    $excerpt = get_post($entry->ID);
    				$excerpt = preg_split( '/<!--more(.*?)?-->/', $excerpt->post_content );
    

    And this line:

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

    with this:

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

    It’s basically the same as your first solution. Regarding the br tags, unfortunately, that is the default behavior of the wp editor. I don’t think we can do anything about it. If you want to preserve the br tags, try not to switch to the visual editor. You can also try this plugin:

    https://wordpress.org/plugins/toggle-wpautop/

    Cheers!
    Ismael

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