WordPress.org

Ready to get started?Download WordPress

Forums

YOP Poll
[resolved] Line break causing answer to line up under radio (13 posts)

  1. astonishedman
    Member
    Posted 10 months ago #

    I have the issue where the answer is not beside the radio button, rather it is under it. I found the posts to suggest:

    #yop-poll-answers-%POLL-ID% ul li input {
    float: left;
    margin: 0 5px 0 0;
    }

    This did not work. I looked at the source code and each line looks similar to this:

    <li class="yop-poll-li-answer-2_yp5245ec847fddb">
    			<input type="radio" value="8" name="yop_poll_answer" id="yop-poll-answer-8" /><br />
    			<label for="yop-poll-answer-8">Rise and Shine</label><br />
    			<span class="yop-poll-results-text-2_yp5245ec847fddb"></span></p>
    </li>

    Note the line break after the radio and again after the answer. Why is that being put in there and where. I FTP'd into the server and found all the code. I searched each php and js file for <br /> and could not find. How can I solve this so that my answers will rest beside my radios?

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

  2. YOP
    Member
    Plugin Author

    Posted 10 months ago #

    Hi astonishedman,

    Please send us a link to the page where you have the poll.

    Regards,

    YOP Team

  3. astonishedman
    Member
    Posted 10 months ago #

    http://www.morethanmusicinc.com/?page_id=3335&preview=true

    It wasn't published as it was a new page. But I published it so you can look at it. I noticed too that the radios do not select.

    This is a new installation. The only thing that has been customized is the CSS of the White template just to try to make it line up right. Everything else is as it was.

  4. YOP
    Member
    Plugin Author

    Posted 10 months ago #

    Hey astonishedman,

    First edit the template you used for your poll and in "Template Before Vote" section replace

    %POLL-ANSWER-CHECK-INPUT%
    %POLL-ANSWER-LABEL%
    <span class="yop-poll-results-text-%POLL-ID%">%POLL-ANSWER-RESULT-LABEL%</span>

    with

    %POLL-ANSWER-CHECK-INPUT% %POLL-ANSWER-LABEL% <span class="yop-poll-results-text-%POLL-ID%">%POLL-ANSWER-RESULT-LABEL%</span>

    Then go to the CSS section and replace

    <div id="yop-poll-custom-%POLL-ID%">

    with

    <div style="clear:both;"></div>
    <div id="yop-poll-custom-%POLL-ID%">

    Also, in the CSS section, after

    #yop-poll-container-success-%POLL-ID% {
    font-size:12px;
    font-style:italic;
    color:green;
    }

    add

    #yop-poll-answers-%POLL-ID% ul li:before {
    content: "";
    }

    #yop-poll-custom-%POLL-ID% ul li:before {
    content: "";
    }

    Please let us know if you need more help.

    Best wishes,

    YOP Team

  5. astonishedman
    Member
    Posted 10 months ago #

    That didn't work. I implemented all of the above and the question is still returning under the radio button. I looked at the source and it is still putting a line break after the input and after the question. As long as it is injecting that I don't see how it can work. Here is one of the lines in the source code.

    <li class="yop-poll-li-answer-2_yp524d76667f855">
    			<input type="radio" value="8" name="yop_poll_answer" id="yop-poll-answer-8" /><br />
    			<label for="yop-poll-answer-8">Rise and Shine</label><br />
    			<span class="yop-poll-results-text-2_yp524d76667f855"></span></p>
    </li>

    How do I get rid of the <br />?

  6. YOP
    Member
    Plugin Author

    Posted 10 months ago #

    Hey astonishedman,

    Edit your template in the JavaScript section look for this line

    jQuery(document).ready(function(e) {

    and under it add

    $(".yop-poll-li-answer-%POLL-ID% br").remove();

    This should fix the problem.

    Regards,

    YOP Team

  7. astonishedman
    Member
    Posted 10 months ago #

    That worked. Thanks so much.

    Got another question. Would there be any way to add programming to this plugin that would allow sharing your vote to Facebook from the results page?

  8. YOP
    Member
    Plugin Author

    Posted 10 months ago #

    Hi,

    At the moment you can not do that but we will make this option available in a future release.

    Best wishes,

    YOP Team

  9. astonishedman
    Member
    Posted 10 months ago #

    would it be a mod you would do for hire?

  10. astonishedman
    Member
    Posted 10 months ago #

    That fix ceased working. You can look at
    http://www.morethanmusicinc.com/theone/

    Rather than some javascript to strip the line breaks after the page loads, I would much rather edit the template where these question lines are built to not include them in the first place. Can you direct me to where this code is assembled and let me alter it there?

  11. astonishedman
    Member
    Posted 10 months ago #

    I figured it out!! Actually the solution is in your original answer to me above, I just didn't see the distinction. When you said replace ... with ... I did, but then returned the lines of code for neatness. But that was the whole problem to begin with. The WordPress edit window injects a
    when you return to the next line of code. So moving everything to one line and just let it wrap naturally did the trick.

    Hope this further explanation helps someone else down the road.

  12. YOP
    Member
    Plugin Author

    Posted 10 months ago #

    Hey astonishedman,

    This is caused by the break line
    between the textbox and text, as you can see here

    <input id="yop-poll-answer-5" type="radio" name="yop_poll_answer" value="5">

    <label for="yop-poll-answer-5">I Believe in You</label>

    To fix this simply remove
    In addition, in Template Before Vote, where you have

    %POLL-ANSWER-CHECK-INPUT%
    %POLL-ANSWER-LABEL%
    <span class="yop-poll-results-text-%POLL-ID%">%POLL-ANSWER-RESULT-LABEL%</span>

    you can write the text in a single line

    %POLL-ANSWER-CHECK-INPUT% %POLL-ANSWER-LABEL% <span class="yop-poll-results-text-%POLL-ID%">%POLL-ANSWER-RESULT-LABEL%</span>

    Regards,

    YOP Team

  13. astonishedman
    Member
    Posted 10 months ago #

    Ha. You must have been typing that same as I was above. You are absolutely correct. Thank you.

Reply

You must log in to post.

About this Plugin

About this Topic