Tagged: page excerpt
-
AuthorPosts
-
February 28, 2017 at 7:57 pm #753183
First of all, thank you for a great theme with an absolutely fantastic visual page builder! :-) I allways end up going back to Enfold when I have tried to build with something else, thinking “why on earth didn’t I just use Enfold in the first place?”
To the point then; Is it possible to make boxes on a page with excerpt from pages? Not post, but pages?
Homepage is a page and underneath the slider, I would like 3 boxes with excerpts from subpages (headline, 2-3 lines of the first part og the text and a “read more” -ish).
Is that possible?
March 6, 2017 at 7:59 am #756201Hey Tanja!
Thank you for using Enfold.
Are you using the blog posts element’s grid layout? Please add this filter in the functions.php file to query the page instead of post.
add_filter('avia_post_slide_query', 'avia_post_slide_query_mod', 10, 2); function avia_post_slide_query_mod( $query, $params ) { $query['post_type'] = 'page'; $query['tax_query'] = ''; return $query; }
Best regards,
IsmaelMarch 6, 2017 at 2:48 pm #756428Hi Ismael,
Thank you for your reply! When you say “the blog post element’s grid layout” do you mean this feature?If it is, then yes it could be. Or any ohter frature that could provide a box with an excerpt from a given page.
What I try to acheive is have the 3 grey boxes belov the slider, contain excerpts form specifik pages. Not just the latest 3 pages, but 3 different pages that i determin.
Would that be possible with what you suggest?
March 7, 2017 at 6:02 am #756758Hi!
The code above should display pages instead of posts if you’re using the blog posts element. If you want to create the layout in the screenshot, try to add columns, add a custom background then use the following shortcode in a text or code block:
[avs_page_excerpt id="13"]
And in the functions.php file, add this:
function avs_get_page_excerpt($args) { extract(shortcode_atts(array( 'id' => '' ), $args)); $excerpt = get_the_excerpt($args['id']); return $excerpt; } add_shortcode('avs_page_excerpt', 'avs_get_page_excerpt');
The shortcode will get the excerpt from the page with the designated id. Unfortunately, there is no element that will automatically create the layout that you’re after so you need to create a custom shortcode and add some css modifications.
Cheers!
IsmaelMarch 7, 2017 at 4:05 pm #757059This was exactely what I was hoping for Ismael – thank you! It dosn’t have to be automatic, this is more that adequate, as long as I can get an excerpt from a specific page, like I can with this solution.
Thank you again! :-)
March 8, 2017 at 11:04 am #757690 -
AuthorPosts
- You must be logged in to reply to this topic.