Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #983749

    Ich würde gerne im Portfolio Raster die Anzahl Kommentare wie bei “Blog Beiträge” anzeigen lassen.
    Auf folgender Seite https://www.schwarz-auf-weiss.blog/ wird am Ende der Seite zuerst der “Portfolio Raster” und anschließend “Blog Beiträge” verwendet. Ist dies möglich?

    #983862

    Hey allerart,

    can you please post in English so we can be able to help faster?

    Best regards,
    Basilis

    #983893

    I’m using the “Portfolio Grid” and the “Blog posts” on the following site https://www.schwarz-auf-weiss.blog/. In the “Porfolio Grid” i also want to use the number of the comments like in the “Blog posts”. Is this possible?

    #983968

    Hi,

    Thank you for the update.

    You have to modify the config-templatebuilder > avia-shortcodes > portfolio > portfolio.php file. Add this code around line 653

    if ( comments_open() ) {
    	if ( $num_comments == 0 ) {
    		$comments = __('No Comments');
    	} elseif ( $num_comments > 1 ) {
    		$comments = $num_comments . __(' Comments');
    	} else {
    		$comments = __('1 Comment');
    	}
    	$write_comments = '<a href="' . get_comments_link() .'">'. $comments.'</a>';
    } else {
    	$write_comments =  __('Comments are off for this post.');
    }
    
    $output .= "<div class='grid-entry-excerpt grid-comments entry-content' ".$write_comments."</div>";

    Best regards,
    Ismael

    #985347

    Thank you for your help. In the last line you have a fault. There is > missing.

    I have adapted your code by the following, because your code hasn’t generated the text.
    Perhaps someone can need it. Thank you for your help.

    $num_comments = get_comments_number($the_id);

    if ( $num_comments == 0 ) {
    $comments = __(‘0 Kommentare’);
    } elseif ( $num_comments > 1 ) {
    $comments = $num_comments .__(‘ Kommentare’);
    } else {
    $comments = __(‘1 Kommentar’);
    }
    $write_comments = ‘‘. $comments.’‘;

    $output .= “<div class=’grid-entry-excerpt entry-content’>”.$write_comments.”</div>”;

    #985448

    Hi,

    Great, glad you spotted missing character and thanks for sharing the correct code. Please let us know if you should need any further help on the topic or if we can close it.

    Best regards,
    Rikard

    #985455

    Thank you. You can close it.

    #985573

    Hi,

    Thanks for the feedback. Please open a new thread if you should have any further questions or problems.

    Best regards,
    Rikard

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘Portfolio Raster’ is closed to new replies.