WordPress.org

Ready to get started?Download WordPress

Forums

upPrev
[resolved] UpPrev and a Custom Field (4 posts)

  1. popsantiago
    Member
    Posted 1 year ago #

    Hi,

    I want to change the description post of the UpPrev div, i find this way :
    Line 453 ==> i change get_the_excerpt() by
    $item .= sprintf( '<p>%s</p>', get_post_meta(get_the_ID(),'description_visit_factory',true) );

    But this field didn't be excerpted...
    How can i use the "$excerpt_length" to excerpt my custom field ?

    I think the UpPrev file got a function, because when i use get_the_excerpt() mine is more than 5 words (for the test) and upPrev give me only 5 words like the config plugin... But i can't find this function.

    Thank for the help.

    http://wordpress.org/extend/plugins/upprev/

  2. Marcin Pietrzak
    Member
    Plugin Author

    Posted 1 year ago #

    Excerpt length is setting in line: 363-365:

    if ( $excerpt_length > 0 ) {
        add_filter( 'excerpt_length', 'iworks_upprev_excerpt_length', 72, 1 );
    }

    And affect only (get_)the_excerpt() functions using build-in filters. I don't limit words by my own function.

    You can't use $excerpt_length inside upPrev plugin, but You can use this outside:

    get_option( 'iworks_upprev_excerpt_length' );
  3. popsantiago
    Member
    Posted 1 year ago #

    That's done !
    Really thank !

    My that's could be an extra feature for next release ;-)
    Admin option Switch Content for CustomField > put the Key
    And Displaying in the UpPrev...

    I don't know... But i did it for me.

    See your and thanks for fast reply

  4. Marcin Pietrzak
    Member
    Plugin Author

    Posted 1 year ago #

    My that's could be an extra feature for next release ;-)
    Admin option Switch Content for CustomField > put the Key
    And Displaying in the UpPrev...

    You can use iworks_upprev_box_item to totally change a content of each item.

    Something Like this example, but change static content to Your:

    http://upprev.com/is-there-a-way-i-can-use-non-post-content-in-this-plugin.html

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags