-
AuthorPosts
-
July 10, 2018 at 5:26 pm #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?July 10, 2018 at 9:47 pm #983862Hey allerart,
can you please post in English so we can be able to help faster?
Best regards,
BasilisJuly 10, 2018 at 10:55 pm #983893I’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?
July 11, 2018 at 3:29 am #983968Hi,
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,
IsmaelJuly 14, 2018 at 12:08 am #985347Thank 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>”;
July 14, 2018 at 9:17 am #985448Hi,
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,
RikardJuly 14, 2018 at 9:47 am #985455Thank you. You can close it.
July 15, 2018 at 6:41 am #985573 -
AuthorPosts
- The topic ‘Portfolio Raster’ is closed to new replies.