Forums

grab more link as variable? (3 posts)

  1. doodlebee
    Member
    Posted 2 months ago #

    This is a bizarre question, I know... but I wanted to know if I could possibly grab the more link (i.e. the_content('read more');) as a variable to see if it's being applied?

    basically I need to put the link in a weird spot that isn't customizable via CSS (which is how I normally do it). Instead of at the end of the post content, I need it to be in the post meta section. Right now, I basically used $strip_teaser to make it invisible at the end of the post, and hard-coded a read more link in the post meta. However, now the link shows up on ALL posts - whether <--more--> is used or not. SO I was wondering if there was a way to grab it as some kind of variable and either echo it out in a new spot, or check to see if <!--more--> was used and if so, have the link display.

    I know I could probably do this with a filter, but I was hoping for a cleaner (and faster) method?

  2. esmi
    Member
    Posted 2 months ago #

    Could you use a combination of get_the_content and strpos to check for a class="more-link"?

  3. doodlebee
    Member
    Posted 2 months ago #

    Yeah, that *is* what I ended up doing, but for some reason, it's not taking. I'm troubleshooting more (there's got to be some odd reason as to why - maybe a good night's sleep has helped and I'll see it), but i was hoping for something a little simpler than that. Oh well, whatever works I guess ;) If I figure out why my code isn't taking, I'll post the solution.

    Thanks! :)

Reply

You must log in to post.

About this Topic

Tags

No tags yet.