• Resolved johnnyb

    (@johnnyb)


    Hi,

    I need to show excerpts on my front page. You would think that I could just call the_excerpt() but I need to be able to specify the ‘more’ text and have HTML displayed like it does with the_content().

    I can’t use the quicktag <!--more--> in the posts because I won’t be writing them. Essentially, I’d like the_content() to take a parameter that says where to cut it off, (so many words or characters or whatever). Is there a way to do this short of hacking the function itself?

    Thanks,
    John

Viewing 12 replies - 1 through 12 (of 12 total)
  • Did you search for a plugin for this? Give that a shot next time. There are lots readily available that help you limit the_content. Here’s the one I use:
    https://labitacora.net/comunBlog/limit-post.phps

    The excerpt reloaded can work that way too…. Check the plugins list on Codex.

    Thread Starter johnnyb

    (@johnnyb)

    Cool thanks. By chance do you know if any of these can be integrated into a theme – so if you just activate the theme and the plugin will work too?

    Well, I didn’t have to do any tweaking to the “look” using the excerpt reloaded, if that’s what you mean. I just tweaked the options so the excerpts displayed the way I wanted them on another site.

    If necessary, you could (and might have to) tweak the css for font size, etc. depending on what you have in mind.

    Do you mean for a theme you want to package and make available? I’m not sure that you can distribute plugins with themes. Maybe you’d just need to let everyone know that your theme uses a certain plugin and that plugin needs to be activated in order to use your theme.

    I’ve seen themes packaged with plugins. Generally I won’t use them though – but that’s mostly because I do my own themes not use others’.

    Thread Starter johnnyb

    (@johnnyb)

    Ok. I’ll see what I can do. I do mean for a theme that I want to package and make available. I’ll try to figure out how to do it if possible and maybe write something about it or post here, (or both;)) if I figure it out.

    Can you mark this as “Resolved,” then? Or is it still up in the air? I think that a question of how to package plugins for distribution with the theme is another question (and one I’d like to see answered, too).

    Thread Starter johnnyb

    (@johnnyb)

    Done. I will start a new topic for packaging plugins with themes.

    I’ll keep my eyes peeled.

    Thread Starter johnnyb

    (@johnnyb)

    Actually, check out this thread. It seems that you can just drop plugins into the functions.php file of your theme. I just did it with the_excerpt_reloaded() and it seems to be working.

    No clue on how it’ll work with multiple plugins though.

    Oh, sure! And multiple plugins would work just fine as long as they are all called by different function names. The Kubric theme comes with this and I don’t know why I didn’t think of it before. All solved, then!

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Need the_content() to work like the_excerpt()’ is closed to new replies.