Forum Replies Created
-
AuthorPosts
-
February 20, 2019 at 9:01 am in reply to: show correct singular/plural-text in headline of tag-pages after wp_query #489634SoenkeParticipant
Hallo,
I found the following solution:
if ($wp_query->found_posts==1){
echo " article)";
}
else echo " articles)";Greetings
February 8, 2019 at 11:30 am in reply to: show correct singular/plural-text in headline of tag-pages after wp_query #489424SoenkeParticipantI deleted simple hooks an now there is the following code in my functions.php:
add_filter( 'genesis_before_loop', 'tag_title');
function tag_title() {
if(is_tag()) {
global $post, $wp_query;
printf(__('<h1>%s</h1>'), single_cat_title('', false) );
echo "(";
echo $wp_query->found_posts;
echo " Artikel zum Stichwort)";
echo "<br/> <br/>";
}}if I change the phrase "echo $wp_query->found_posts;" with the given code "echo $wp_query->found_posts . ($wp_query->found_posts == 1) ? 'article' : 'articles';" the plural-form isn't shown. Only
... -> tag-title<-
(article Artikel zum Stichwort)is shown. This result is shown as well tag archive has one or as plural results. Without the given code the result is:
... -> tag-title<-
(1 Artikel zum Stichwort) for a single result and... -> tag-title<-
(2 Artikel zum Stichwort) for plural resultsI do not know how to solve the problem ...
Greetings ...
February 4, 2019 at 10:03 am in reply to: show correct singular/plural-text in headline of tag-pages after wp_query #489289SoenkeParticipantHallo,
I added it in genesis_before_loop Hook.
The output without the correct plural form works. "Execute php on this hook?" is enabled.
Thank you for answering!
February 4, 2019 at 2:29 am in reply to: show correct singular/plural-text in headline of tag-pages after wp_query #489280SoenkeParticipantHallo Victor,
thank you very much for the answer!
I added:
(<?php echo $wp_query->found_posts; echo $wp_query->found_posts . ($wp_query->found_posts == 1) ? 'article' : 'articles'; ?> to the keyword)
... but something doesn't work:
I use the code above in "simple hooks" - I always get the singular form (article).
Greetings ...
SoenkeParticipant... the result is not shown ... only the code [post categories], ... [post_tags] appears.
It's the same with snippet 4.
SoenkeParticipantTicket is submitted ...
SoenkeParticipantHallo Gary,
...
1)
... warnings disappear ...
2)
... "[post_categories]" is shown ... but the categories aren't named
3)
... [post_tags before="Before: "] is shown ... but the tags aren't named
4)
... white screen with error code appears ...
"Parse error: syntax error, unexpected '99' (T_LNUMBER) in /homepages/23/d278325892/htdocs/blog7/wp-content/themes/eleven40-pro/functions.php on line 5"
Thanks!
SoenkeParticipantHallo Gary,
disabling plugins and refreshing cache doesn't solve the Problem .
Deleting language files in geneses or child theme and refreshing cache doesn't solve the problem.
Thanks for help!
p.s.: there are many sites having the same problem, try seeking
"Warning: sprintf(): Too few arguments in /themes/genesis/lib/functions/markup.php on line 61"
using google!
SoenkeParticipantHallo,
I get the error on 1 site running Genesis and eleven 40 pro in post-meta (http://rechtsanwalt-und-verwaltungsrecht.de):
The errors appear on home, categories and posts (not tags). Probably the code in my functions.php ist invalid:
add_filter( 'genesis_post_meta', 'sk_post_meta_filter' ); function sk_post_meta_filter($post_meta) { if ( is_category() ) { $post_meta = '[post_tags before="Stichworte: "]'; } elseif ( is_tag() ) { $post_meta = '[post_categories before="Artikel im Archiv: "]'; } elseif ( is_home() && !is_sticky() ) { $post_meta = '[post_categories before="Artikel im Archiv: "][post_tags before="Stichworte: "]'; } elseif ( is_sticky() ) { $post_meta = ''; } elseif ( is_single() ) { $post_meta = '[post_categories before="Artikel im Archiv: "][post_tags before="Stichworte: "]'; } return $post_meta; }
I saw the error on many sites using google.
Thanks for help!
February 7, 2014 at 5:14 am in reply to: Error code “out of memory” – seo-settings.php – upgrade to 3.8.1 #89102SoenkeParticipantIn fact the support was right - thanks for help!
The provider has changed some settings and it works!
-
AuthorPosts