Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #1224284

    Hi Team,

    I added this to my child theme functions.php to create a different blog page template:

    // Different template for static Blog page (News) in Enfold instead of archive style
    // The archive pages don’t support an “Advanced Layout” blog template but you can select a different
    // static blog template if you don’t like the archive page layout.
    add_filter('avf_blog_style','avia_change_archive_blog_layout', 10, 2);
    function avia_change_archive_blog_layout($layout, $context){
    if($context == 'archive') $layout = 'blog-grid';
    return $layout;
    }
    add_filter('avf_blog_style','avia_change_category_blog_layout', 10, 2);
    function avia_change_category_blog_layout($layout, $context){
      if($context == 'archive') $layout = 'blog-grid';
      return $layout;
    }

    The page (built with ALB) has the “Blog Posts” element added to it from “Content Elements”.

    It has the following config:
    – Display blog posts
    – Category = Blog
    – Grid Layout
    – Title+Excerpt+ReadMore (<<<<< Note: Read More never works/shows…)
    – Deactivate offset
    – Always display the element
    Styling:
    – if I set pagination to Yes it never shows pagination…

    So there are two issues:
    1) Read More button never ever shows up
    2) Pagination does not want to activate

    Is there any way to fix this? Thanks in advance for your help!

    Regards,
    Rob

    Details in private

    Added info 2020-06-24: child theme archive.php contains:

                            if(!empty($post_ids))
                            {
                                $atts   = array(
                                    'type' => 'grid',
                                    'items' => get_option('posts_per_page'),
                                    'columns' => 3,
    				'contents' => 'excerpt_read_more',
                                    'class' => 'avia-builder-el-no-sibling',
                                    'paginate' => 'yes',
                                    'use_main_query_pagination' => 'yes',
                                    'custom_query' => array( 'post__in'=>$post_ids, 'post_type'=>get_post_types() )
                                );
    • This topic was modified 4 years, 5 months ago by rob2701.
    #1226704

    Hey Rob,

    Sorry for the delay. The pagination doesn’t display maybe because there are only 12 posts in the Blog category and the maximum number of posts that are allowed to display in the archive pages (Settings > Reading) is also set to 12. (see private field)

    Best regards,
    Ismael

    #1226714

    Hi Ismael,

    Thanks for the clarification. Almost ashamed now, I should have realised that the archive page used depends on the WP Reading setting which was indeed 12. I had only looked at the Blog Posts element itself, where I had set the number of posts to 3 and noticed no difference. Thanks for solving that by pointing it out. My bad. Works perfectly once I do the post number per page in the WP Reading setting… :-))

    Added remark 2020-07-01:
    Since pagination for Blog posts only obeys the “WP > Settings > Reading > Blog pages show at most:”
    So what is the setting in the “Blog Posts element > Pagination > Post Number” for?
    Since that is always overridden by the WP Reading setting, perhaps it is better if the setting in the Blog Posts element mentions something like “This number is taken from the WP Settings > Reading” and remove the dropdown to set the number of posts? Just a thought for the next theme update. :-)

    What remains is the ReadMore button which refused to show up, even though (in the Blog Posts element) I have set it to display “Title and Except + ReadMore”. How can that be solved?

    By the way, related to this are some breadcrumb issues with the archive blog page, different thread (same page on this website):
    https://kriesi.at/support/topic/breadcrumbs-in-blog-archive-page-layout/

    Thanks for your time! Kind regards,
    Rob

    • This reply was modified 4 years, 4 months ago by rob2701. Reason: Added remark regarding post number setting in blog posts element
    #1227481

    Hey!

    No worries. We often missed the little things.

    So what is the setting in the “Blog Posts element > Pagination > Post Number” for?

    That is for when a custom page contains a Blog Posts element. It is also used when the Blog Layout is set to “Use the advance layout builder..” Please note that archive pages use the archive.php file template, so it doesn’t rely on the blog element or its settings.

    Cheers!
    Ismael

    #1227496

    Hi Ismael,

    Thanks for the explanation, all clear now to me, finally :-)

    My child theme archive.php contains:

    'contents' => 'excerpt_read_more'

    Yet I cannot seem to get the “ReadMore” to show up. Any ideas on that?

    Kind regards,
    Rob

    Remark added 2020-07-03:
    When I create a page with a Blog Archives widget in the content area, then the readmore link show just fine on those blog archive pages. So, although I am still curious as to why it doesn’t show on my alternative (archive) blog posts page despite being set, I will not be using it there (or anywhere else), because I already have the image linking to the article and the ReadMore would just create a redundant (duplicate) link to the same post.
    So no hurry, just curious about it. Thanks for all your help!

    • This reply was modified 4 years, 4 months ago by rob2701. Reason: Remark added 2020-07-03
    #1228343

    Hi,

    Looks like you’ve already managed to get the read more links to display in the archive page. Did you set the “For each post in a feed, include” option in the Settings > Reading panel to “Summary”?

    Thank you for your patience.

    Best regards,
    Ismael

    #1228350

    Hi Ismael,

    Yes , I did indeed manage to display the Read More, but _only_ on the Blog Category Archive pages. But I don’t use those for now, they just appear — against my will :-) — because the Blog Posts when opened have a wrong breadcrumb link which points to the Blog Category archive instead of to the Blog Page (see my other post about that issue).
    https://kriesi.at/support/topic/breadcrumbs-in-blog-archive-page-layout/
    Because of that I have created the adapted Blog Archive page to look just like the Blog Post Elements page, so it would not be so obvious that we land on the Blog Category Archive instead of the normal Blog Page when the (wrongly set) breadcrumb link is clicked from an opened blog post. I hope I explain myself clearly this time without confusing the two.

    However, I did NOT manage to get the ReadMore links to show on my real Blog Page, which is a page with a Blog Posts element. If you look at the Blog page (top menu) you will see that the link does NOT appear, even though I have set “Display Title and Excerpt + ReadMore” in the settings of the Blog Post element under “Define Blog Grid layout – Do you want to display a read more link?”. So I would like to know why it doesn’t appear there.
    And yes, I have set “For each post in a feed, include” option in the Settings > Reading panel to “Summary”?, of course.
    Always been that way.

    I apologize for the confusion in my earlier descriptions, it was done a long time ago and I confused the two pages (Blog Category Archive and Blog Element Page) because I had made them _look_ the same because of the breadcrumbs issue.
    I hope I explained it better this time… Again, sorry if I confused the issue earlier.

    Thanks for your help!
    Kind regards,
    Rob

    • This reply was modified 4 years, 4 months ago by rob2701. Reason: correction typos
    #1229361

    Hi,

    The settings of the Blog Posts element don’t reflect in the front end because the Enfold > Blog Layout > Blog Layout is set to “Grid Layout”, so by default it’s going to use the index.php file. To adjust that, we set the Enfold > Blog Layout > Blog Layout to “Use the advance layout builder..” so that the blog page will actually display the content of the advance layout builder including the Blog Posts element.

    The read more link now displays in the Blog page, but the breadcrumb issue is still visible in the archive pages. Let me get back to you on that.

    We also reset the Settings > Reading options to default because the front and posts page is already set in the theme options.

    Thank you for your patience.

    Best regards,
    Ismael

    #1229398

    Hi Ismael,

    Thanks for delving into this and fixing the display of the ReadMore. It had been bugging me for a long time that I couldn’t get it to display and I couldn’t find the solution. With your fixes, the ReadMore now displays very nicely on the Blog, on the Archive for Category Blog and on the Archives widget.
    I will not be using the ReadMore on this particular Blog page (because of duplicate links – accessibility – having the link already set on the featured image), but it is good to know that I now have a choice for future pages on different sites. I’ve left it enabled for now however on the Blog, while you still work on it.
    To facilitate your checking I’ve added submenu entries to Blog for “Archive for Category: Blog” and Blog Archives(widget)”.

    Thanks for all the help so far,
    Rob

    #1230169

    Hi,

    Looks like you’ve already found a solution for the breadcrumb issue.

    // https://kriesi.at/support/topic/breadcrumbs-in-blog-archive-page-layout/#post-1228764

    Please don’t hesitate to open a new thread if you need anything else.

    Have a nice day.

    Best regards,
    Ismael

    #1230174

    Hi Ismael,

    That’s funny, I hadn’t even noticed that. I was still at the same point you were at in your last answer, that the blog archive items breadcrumb was still displaying Home / Blog / Blog / item.
    All I did was create a sub menu item for the archive (blog category) with a custom link, so it would be easier for you to fix.I now see that that action has also made sure that the fix for the opened blog entries also applies to the opened blog archive entries. Now everything indeed points to the real blog page in the breadcrumbs.

    I wish I could say I found the fix, but no, this was just a lucky side effect of another action :-)
    Don’t know if this actually fixes the last issue you were looking to fix, or if this is a side effect issue of placing the archive page as a sub of the blog in the menu…

    But there is still the minor issue left of the blog category archive page itself (so not the opened item) showing Home / Blog / Blog in the breadcrumb, where the first blog points to the real blog page. The second blog in the breadcrumb is supposed to show the item name (which in this case is “Archive for category: Blog”) but instead just says Blog.
    Don’t know if that is how it’s supposed to be / intentional.

    Unless you want to investigate some more, let me know – then I will keep the login to the devsite open.
    If not, I’m good as it is now, thanks for all the help! Then.you can close this.

    Cheers,
    Rob

    Added remark for ReadMore issue:
    Your solution for setting the WP Settings to default cannot be used, as it results in an issue with Blog Grid pagination (404s). Blog Grid page pagination only works when the WP settings are set the same as the Homepage & Blog Settings in Enfold theme. You may want to look into that.

    • This reply was modified 4 years, 4 months ago by rob2701. Reason: Added remark for ReadMore issue (pagination Blog grid 404s)
    #1230841

    Hi,

    I now see that that action has also made sure that the fix for the opened blog entries also applies to the opened blog archive entries. Now everything indeed points to the real blog page in the breadcrumbs.

    It’s a happy accident then. Please let us know if you need anything else.

    Added remark for ReadMore issue:
    Your solution for setting the WP Settings to default cannot be used, as it results in an issue with Blog Grid pagination (404s). Blog Grid page pagination only works when the WP settings are set the same as the Homepage & Blog Settings in Enfold theme. You may want to look into that.

    This might be due to the Blog page and Blog category having the same slug, so the server doesn’t know where to redirect the paginated pages. You may want to consider changing the name of the category.

    Thank you for your patience.

    Best regards,
    Ismael

    #1230859

    Hi Ismael,

    Thanks for all the help, info and patience, I realise you guys are very busy.
    All solved and can be closed. Nice!

    Have a good day,
    Rob

    #1231103

    Hi,

    If you need additional help, please let us know here in the forums.

    Best regards,
    Jordan Shannon

Viewing 14 posts - 1 through 14 (of 14 total)
  • The topic ‘No ReadMore or Pagination on alternative template Blog Posts’ is closed to new replies.