-
AuthorPosts
-
July 5, 2013 at 9:43 pm #25818
This may be something I’m missing on my end, but I’m having some trouble using the more tag when I use the Avia Layout Builder to create my main page. My posts have the <!–more–> tag in them, but it doesn’t seem to be respected, no matter what I try for the mode. I’ve flipped from ‘Full Content’ to ‘Excerpt’ to ‘Excerpt with Read More Link’, but none of them work properly with where I’ve defined the more tag to go. With Full Content mode, it does what you’d expect, and just posts the full post content no matter what. With both Excerpt and Excerpt with Read More Link, I’m getting an excerpt that both doesn’t cut off where I put my more tag and also doesn’t show any new paragraph spacings if they’re present before the cut off point. It makes things look pretty horrible.
I’m more than happy to modify code, if someone can point me to the right place, though I’d think that this should be working by default as well. (Plus, it’s a pain to have to keep doing code mods after every update.)
July 5, 2013 at 11:07 pm #128295Aha! I think I found it. For anyone else having the same issue, do this:
Right After
Code:if(!empty($avia_config[‘preview_mode’]) && !empty($avia_config[‘image_size’]) && $avia_config[‘preview_mode’] == ‘custom’) $size = $avia_config[‘image_size’];Do:
Code:global $more;
$more = 0;That really should be added to the next version I think. Or, perhaps another option when creating a blog section should be there for ‘Excerpt with <!–more–> tag’.
That’s just my two cents.
July 5, 2013 at 11:08 pm #128296Whoops. I should mention that the file you need to edit is loop-index.php in the ‘includes’ directory.
July 5, 2013 at 11:17 pm #128297Doh! I spoke too soon. Doing that code insert I just did makes it apply to the posts page as well. I’ll have to tweak this a bit I think.
July 5, 2013 at 11:34 pm #128298Okay, I think this time it actually works.
In includes/loop-index.php look for this:
Code:while (have_posts()) : the_post();After that, add:
Code:if (!is_single()) {
global $more;
$more = 0;
}That does the trick for me; however, depending on your situation, you might need to use is_singular instead of is_single. I’m not 100% on the difference though, so I stuck with the one I know should work.
Also, you’ll want to avoid using is_page,as that one breaks inside loops.
Hopefully that helps some people out.
July 6, 2013 at 6:28 am #128299Glad you found a solution. The difference between is_singular and is_single is that “is_single” will only check if you’re viewing a post or custom post. is_singular will return “true” on all “single” entry pages – posts, custom posts and pages. Only archives, search pages, etc. will return false. is_page won’t work because it only returns true on pages and it won’t work with posts.
-
AuthorPosts
- The topic ‘More Tag with Blog Section’ is closed to new replies.