YOP Poll
[resolved] Give one poll two different templates? (4 posts)

  1. Carrie
    Posted 3 years ago #

    I have a poll. I want it to appear in a widget in the sidebar, which requires a relatively narrow width. So I've adjusted the stylesheet for that poll so that it fits.

    But then I want the same poll to also be able to be displayed in the body of a page. I've used a shortcode to display the poll or it's results - but I want it to display with a different, wider view when it appears that way. Is there some way to specify a different template in the shortcode?


  2. YOP
    Plugin Author

    Posted 3 years ago #

    Hey Carrie

    You need to do a couple of changes for this.

    First in the css of the template you are using make sure you have the code below

    #yop-poll-container-%POLL-ID% {

    When you add the shortcode, use <div style="width:200px">[yop_poll id="POLL_ID"]</div> instead. Your editor needs to be in text mode when adding the shortcode.

    You can change the 200px to the width you need.

    Please let us know if this solves your issue.

    Best Regards,
    YOP Team

  3. Carrie
    Posted 3 years ago #


    I assume you meant 100%, not 100px, right? I did update the width to a % and it worked like a charm! I will add that the yop poll, for whatever reason, thinks that 100% is larger than the space it has by about 20px in both instances, whereas other content in the same div doesn't. I don't know if it's padding, margins or what. I didn't spend the time to troubleshoot. But rather than 100%, I used 90% and it was perfect. Thank you!


  4. YOP
    Plugin Author

    Posted 3 years ago #

    Yes, 100%.

    my bad.

    glad to hear everything works as you want.

    best regards,
    YOP Team

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic


No tags yet.