Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End wp_trim_excerpt?

  • This topic is empty.
Viewing 1 post (of 1 total)
  • Author
    Posts
  • #37128
    Vermaas
    Participant

    Hi all,

    I’m struggling with an issue about the excerpt. What i’ve got, is the following.

    I’ve got an id of a page. And i want that specific page to be displayed on a particular place. But i don’t want to show the full content of the post. I know what you’re thinking, use the_excerpt!!! But that won’t work in this case, so in my search i found the function wp_trim_excerpt(), and when you put some text into this function, it will give an excerpt of that text.

    Well that’s what the reference guide of WP says, but i don’t get the excerpt of the page, but the whole content.. Probably i’m using it one the wrong way. So, can someone give me a hand?

    This is the code:


    /* Get front-end block's */
    function yandt_content_block( $position ) {
    global $wpdb;
    $content = $wpdb->get_row( "SELECT * FROM wp_yandt_frontcontent_content
    WHERE
    name = '" . mysql_real_escape_string( $position ) . "'" );
    // Get the page by ID
    $ID = $content->content_id;
    $page = get_page( $ID );

    // Check the position
    $extraClass = '';
    if( $position == 'Midden' ) {
    $extraClass = 'middle-one';
    }

    // Build the block
    echo '';
    }
Viewing 1 post (of 1 total)
  • The forum ‘Back End’ is closed to new topics and replies.