-
AuthorPosts
-
November 5, 2018 at 6:42 pm #1029987
Hi,
I have to make a website for exhibitions for a museum. I decided to make the exhibitions with posts. I need the homepage of the website to always show the last post, fully, and only this one, either automatically (would be best), or by selecting the post to display in something like a post article avia element.
Below this post, on homepage only, I need other blocks, like upcoming exhibitions or so.
I don’t see an element to show one post article this way ?
Can you help ?
- This topic was modified 6 years ago by nordtheme.
November 5, 2018 at 11:37 pm #1030106Hey nordtheme,
Please provide a link to the page in question so we can look into this further.
Best regards,
Jordan ShannonNovember 6, 2018 at 12:14 am #1030119I can’t, for now I’m working local… but the question was maybe not clear: I d’need a way to show the content of the one single last post on the homepage (the way it is on the post detail page), just like I’d add a text block or blog articles element. Below that, on the homepage, I need to add other avia content elements.
I tried to use the blog articles, with categories/labels and set it to 1 element full content, but I still get the title and a “read more”.
Could it have something to do with the fact I use the advanced layout editor in my posts ? I think I read something about it but not sure…November 6, 2018 at 5:48 pm #1030478Hi,
any news about this ? This is quite urgent… I tried to do it with a shortcode and a function in functions.php, I can get the post, but the layout is completely messed up…
$output = apply_filters( 'the_content', $post->post_content );
and
$output = do_shortcode($post->post_content);
Am I missing a filter or something ?
November 8, 2018 at 5:41 am #1031102Hi,
Sorry for the late reply, Please try using the blog element, it will allow you to choose to show 1 post if you wish. You can choose to show a category, product, or a tag, which might be the best for you because you could set only one item to have that tag.
It will also have a layout to match the theme, and you can choose to show the full content or a excerpt:
If you would like to use a shortcode instead of a advanced layout builder element, then please open a new post using the default editor and use the “magic wand” in the menu to create a shortcode, it will open the element so you can make your choices, and when you save the shortcode will be shown in the post.
You may find this shortcode easier to use because it includes the layout, but if you want to continue with your shortcode creation, please see this post: How to make a Shortcode to display a custom loop of postsBest regards,
MikeNovember 8, 2018 at 7:15 pm #1031351Hi Mike,
thanks for your answer, I already tried the blog element, seems right configured, but keeps showing me only excerpt and “read more” link
I have the same results with your shortcode… I must be doing something wrong…
Tell me if you see something false in my config, I’ll tray the shortcode hardway if not :-)
- This reply was modified 6 years ago by nordtheme.
November 8, 2018 at 10:30 pm #1031421Hi,
Sorry I can’t read the settings very well because it’s not English, but they seem to right. Is your post using the advanced layout builder? That might be the issue, try using the default editor for the post.
I tested this method on my localhost and it worked for a default editor post.
Can you try adding this text as a text block element to your homepage?Best regards,
MikeNovember 9, 2018 at 12:52 am #1031463Hi,
yes, of course i’m using the ALB, my post (which is the next exhibition of the museum) needs columns design, parallax backgrounds, and stuff from the advanced layout… how can I do it with a regular post ?November 9, 2018 at 5:14 am #1031506Hi,
Thank you, I didn’t know that about your post. I confirmed though testing, that advanced layout builder posts won’t show using this method.
But the “Page Content” element, will allow you to display a advanced layout builder page within another page. It will keep the format and the advanced layout builder elements.
You could copy your post to a new blank page by Enabling the Avia Layout Builder Debugger and copy the debugging code to the new page.
Or you could create the shortcode like you originally wanted to with the info in the pages I linked to earlier.Best regards,
MikeNovember 9, 2018 at 10:33 am #1031598I said it was on the 6th, but no problem
The thing is that this homepage (last post which is next exhibition) needs to become a categorized archive once the new exhibition comes out, that’s why I chose posts.
How come you can’t do such a simple thing (at least looking simple) with a regular ALB element ?
November 9, 2018 at 11:06 am #1031606Your link make more a list of posts than print a post, but I adapted it to use the_content().
Still, the post is incomplete and messed up in layout… I have the first block of the post, the title below (at wrong place) and then… nothing else. Most part of the post is missing.
November 9, 2018 at 11:46 am #1031615I didn’t test any of the suggested option but if nothing of those is working you could create a shortcode and fetch the last post and style it like you want, Further reading: https://codex.wordpress.org/Shortcode_API
Best,
PatrickNovember 16, 2018 at 1:47 pm #1034454 -
AuthorPosts
- You must be logged in to reply to this topic.