• Resolved mvanboordt

    (@mvanboordt)


    Hi,

    I want to edit the excerpt. I have a page that loads excerpts.
    Now I want to have some more control over the excerpt.

    I only want the first sentence. Some are long and some are short so I can’t set a number for max words.

    An other way would be if I could hit enter after a sentence but the excerpt doesn’t accept that. So no matter howmany enters I give behind the first sentence it always shows the next text.

Viewing 12 replies - 1 through 12 (of 12 total)
  • Perhaps you could try a regular expression that gets all the words up until the first occurrence of a period.

    Thread Starter mvanboordt

    (@mvanboordt)

    Yeah and how would I do that?

    Technically speaking 🙂

    Why not just use the Excerpt input in each Edit Post/Edit Page to handcraft your excerpts?

    Thread Starter mvanboordt

    (@mvanboordt)

    sorry I don’t get that?!

    Try looking on Edit Post for the Excerpt panel.

    Thread Starter mvanboordt

    (@mvanboordt)

    Yeah tried that but the Exerpt will not be for a post but for a page.

    I have a snippet text which will link to the complete page.
    With some PHP in my functions.php file I could get the excerpt panel in the edit page but can’t seem to get it working.

    How about Custom Fields? If they don’t show on your Page editor you can activate them in the Screen Options dialog. Create a field called First Sentence, then copy in the text from the content.

    Thread Starter mvanboordt

    (@mvanboordt)

    Ok Garydarling that might be the idea I was looking for

    I’ll check it out and let you know

    Thnx

    Thread Starter mvanboordt

    (@mvanboordt)

    Ok I’ve made a custom post and placed the_meta in my script

    I’ve tried two different ways but they both don’t work.

    the_meta($meta_value, true);

    and

    the_meta();

    If I take a look at the sourcecode of the page I’ll get this:

    <ul class="post-meta"> </ul>

    So there is no content……

    What do I miss?

    Here is what I used on a project, works fine:
    <?php echo get_post_meta($post->ID, 'Sidebar Text', true) ?>

    Thread Starter mvanboordt

    (@mvanboordt)

    Ah great thnx Gary.

    I fixed it like this because my content is on a childpage of the page where it should be shown.

    $short_text = get_post_meta($pageChild->ID, 'short_text', true);
    echo $short_text;

    Thnx for your help

    hi i have a customfield on my posts and i need to display the shorttexte on my homepage can use it like this?

    $short_text = get_post_meta($page ->ID, ‘short_text’, true);
    echo $short_text;

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Edit the Excerpt’ is closed to new replies.