WordPress.org

Ready to get started?Download WordPress

Forums

YOP Poll
[resolved] [yop_poll_archive] (3 posts)

  1. wm
    Member
    Posted 9 months ago #

    3 questions I can not find the answer to:

    1. Can I change the sorting to decending on [yop_poll_archive] page? I want the newest poll on top and the oldest at the bottom.

    2. Can there be a nice divider or some more space between the polls at the [yop_poll_archive] page. They are hard to separate in my 2011 theme.

    3. What file is used to create the [yop_poll_archive]? Can this be edited to solve the above questions? Or is there a standard sullotion?

    http://wordpress.org/plugins/yop-poll/

  2. YOP
    Member
    Plugin Author

    Posted 9 months ago #

    Hi wm,

    1. Edit public-admin.php and look for this function

    public function yop_poll_archive_shortcode_function() {

    Replace
    $archive = YOP_POLL_MODEL::get_archive_polls( 'archive_order', 'asc',
    with
    $archive = YOP_POLL_MODEL::get_archive_polls( 'date_added', 'desc',

    and
    $total_archive = ceil( count( YOP_POLL_MODEL::get_archive_polls( 'archive_order', 'asc',
    with
    $total_archive = ceil( count( YOP_POLL_MODEL::get_archive_polls( 'date_added', 'desc',

    2. Just like for the previous question, edit public-admin.php and look for public function yop_poll_archive_shortcode_function() {

    Where you have

    if ( count( $archive ) > 0 ) {
    foreach( $archive as $poll ) {
    $template .= $this->return_yop_poll( $poll['id'] );
    }
    }

    replace $template .= $this->return_yop_poll( $poll['id'] ); with

    $template .= $this->return_yop_poll( $poll['id'] ).'[your_theme_poll_separator_html_code]';

    where [your_theme_poll_separator_html_code] (and this answers your 3rd question as well) is the html code you want to use to separate the polls.

    Best wishes,

    YOP Team

  3. wm
    Member
    Posted 9 months ago #

    Thanks YOP Team

    The instructions you provided above solved all my questions and the result is exactly the design I requested!

    $template .= $this->return_yop_poll( $poll['id'] ).'<img src="http://separator_image.png" style="padding:10px;">';

Reply

You must log in to post.

About this Plugin

About this Topic