upprev-my-own-content

Is there a way I can use non-post content in this plugin?

Yes. You can use one of build-in filters:

To replace whole box:

add_filter( 'iworks_upprev_box', 'iworks_upprev_box_mycontent' );
 
function iworks_upprev_box_mycontent( $content )
{
    $value = '<div id="upprev_box">';
    $value .= '<h6>My own title</h6>';
    $value .= '<div class="upprev_excerpt">';
    $value .= '<h5>Lorem ipsum</h5>';
    $value .= '<p>Lorem ipsum dolor sit amet, consectetur ';
    $value .= 'adipiscing elit. Vestibulum auctor neque vitae orci ';
    $value .= 'ornare et vehicula eros molestie.</p>';
    $value .= '</div>';
    $value .= sprintf(
        '<a id="upprev_close" href="#" rel="close">%s</a>',
        __('Close', 'upprev')
    );
    $value .= '</div>';
    return $value;
}

Get code: iworks-upprev-static-content.php.zip

Where to put this code?

There are three ways:

  1. made a one-file-plugin and put file into wp-content/plugins, then turn it on
  2. made a one-file-plugin and put file into wp-content/mu-plugins
  3. put this code into function.php in current theme

I recommend using option 1 or 2, but 3 is the easiest.

2 thoughts on “Is there a way I can use non-post content in this plugin?

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>