Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #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.
    #1030106

    Hey nordtheme,

    Please provide a link to the page in question so we can look into this further.

    Best regards,
    Jordan Shannon

    #1030119

    I 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…

    #1030478

    Hi,

    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 ?

    #1031102

    Hi,
    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:
    2018-11-07-222450
    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.
    2018-11-07-223159
    2018-11-07-223322
    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 posts

    Best regards,
    Mike

    #1031351

    Hi Mike,

    thanks for your answer, I already tried the blog element, seems right configured, but keeps showing me only excerpt and “read more” link

    Here is my config:
    config

    Here the result
    result

    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.
    #1031421

    Hi,
    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,
    Mike

    #1031463

    Hi,
    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 ?

    #1031506

    Hi,
    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,
    Mike

    #1031598

    I 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 ?

    #1031606

    Your 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.

    #1031615

    I 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,
    Patrick

    #1034454

    Hi,
    @Resonanz thank you for sharing

    Best regards,
    Mike

Viewing 13 posts - 1 through 13 (of 13 total)
  • You must be logged in to reply to this topic.