Tagged: avia layout builder, bug, more
-
AuthorPosts
-
January 28, 2014 at 7:02 pm #215978
Problem:
when building a page with the layout builder the blog feature gives the oportunity to have
– full text of the post
– intro text
– intro text plus “read more”But this don’t work with the <!more> tag :-(( So all of my 500 posts can’t be displayed on tha startpage within a page build with the layout builder. This “high-end-feature” uses just excerpts for intro??
It only works when I say “show the blog on page xyz” in the theme settings – but then I can’t use the layout builder to make nice pages (eg startpage).
What can I do?
Greets,
Stefan
January 29, 2014 at 10:44 am #216295Hi simpson199!
Please try to insert following code into the functions.php file
add_filter( 'post-format-standard', 'avia_category_content_filter', 15, 1); function avia_category_content_filter($current_post) { global $avia_config; global $more; $more_bak = $more; if(!is_single() && $avia_config['blog_content'] == 'excerpt_read_more') { $more = 0; $current_post['content'] = get_the_content(__('Read more','avia_framework').'<span class="more-link-arrow"> →</span>'); $more = $more_bak; } return $current_post; }
– it should pull the excerpt from the post content and truncate it with the “more” quicktag.
Cheers!
PeterJanuary 29, 2014 at 11:53 am #216325Thanx Peter!
I copy pasted it from here to the end of the file
/wp-content/themes/enfold/functions.php (which is original file)
but the side then is down (white). Has there to be a special place within the file to paste the code?
Greets
Stefan
January 29, 2014 at 12:28 pm #216337Hi!
I think I missed a bracket at the end of the get_the_content() function. I updated the code – please try it again.
Cheers!
PeterFebruary 3, 2014 at 5:59 pm #218891Thanx Peter!
Sorry, but now the whole text of the article is shown on the startpage. The <!–more–> is still ignored on a side made with Avia Layout Architect :-/
But I need the <!–more–> Tag Feature…
Greets Stefan
February 4, 2014 at 9:18 am #219225Hey!
Please try to replace
if(!is_single() && $avia_config['blog_content'] == 'excerpt_read_more')
with
if(!is_single())
Best regards,
PeterFebruary 4, 2014 at 4:51 pm #219463Thanx Peter,
Now the Intro text is good in the Blog view in a page from the layoutbuilder. Cool :-)
But (sorry ;-) ) other overviews like the “Masonry Kacheln”, that shows pictures and intros too, now shows html rubish…
Again an idea? I would screenshot it but here is no options for screenshots…
Greets & Thanks!
Stefan
- This reply was modified 10 years, 9 months ago by simpson199.
February 13, 2014 at 5:12 am #223190February 13, 2014 at 8:28 am #223264Hey!
Try following code
add_filter( 'post-format-standard', 'avia_category_content_filter', 15, 1); function avia_category_content_filter($current_post) { global $avia_config; global $more; $more_bak = $more; if(!is_single()) { $more = 0; $current_post['content'] = strip_tags (get_the_content('')); $current_post['content'] .= $current_post['content'].'<div class="read-more-link"><a href="'.get_permalink().'" class="more-link">'.__('Read more','avia_framework').'<span class="more-link-arrow"> →</span></a></div>'; $more = $more_bak; } return $current_post; }
Best regards,
PeterFebruary 13, 2014 at 3:15 pm #223451Thanx Peter and Josue!
The last code didn’t work in any way, gives serveral new hard errors. Twice intros on the frontpage and crzay stuff on the masonry category view.
Suggestion: I know it’s hard to make support without have a look. The Code that worked best was the modified one before: Post view via the layoutbuilder ok (did make the right things with the more-tags) – but the “Masonry Category View” crashed.
Look: Frontpage ok wp1.gsvbaden.de,
Masonry Category View not: http://wp1.gsvbaden.de/uebersicht-news/
The Code this far
add_filter( 'post-format-standard', 'avia_category_content_filter', 15, 1); function avia_category_content_filter($current_post) { global $avia_config; global $more; $more_bak = $more; if(!is_single()) { $more = 0; $current_post['content'] = get_the_content(__('Read more','avia_framework').'<span class="more-link-arrow"> →</span>'); $more = $more_bak; } return $current_post; }
Thanx :-)
Stefan
- This reply was modified 10 years, 9 months ago by simpson199.
February 18, 2014 at 10:04 am #225397Hi!
The masonry layout doesn’t support the “more” tag and you must use the “excerpt field” for the excerpt. If you want to use both blog types I recommend to use this code instead: https://kriesi.at/support/topic/setting-blog-to-multi-author-big-preview-blog-with-title-excerpt-read-more/#post-221204 – then you can use the “excerpt field” for all posts regardless of the post type.
Regards,
PeterFebruary 27, 2014 at 7:48 pm #230235Thanx Dude, I gonna try this and tell if it worked… Nice support anyway.
-
AuthorPosts
- The topic ‘Bug: No Post-Intro (via more-tag) ist shown when using AVIA Layout Builder’ is closed to new replies.