Support » Plugin: WP-Polls » Can I add a class parameter to wp-polls's shortcode?

  • Resolved erknrio


    I have 2 polls, one with a widget in the main page of my site and other in a post.

    Widget poll:
    Post poll:,0nylT0x#1

    I need differents css for each poll but if I modify the “Poll Voting Form Templates” it change the widget poll and the post poll (that is a problem).

    Can I add a class parameter to load a custom css class? For example:

    [poll id="12" class="post-poll"]

    Other thing: where is the code of the post-poll shortcode? I can add a css class in this code to change header, content and footer :-).

    Thank you very much for your help.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Lester Chan


    Why you need to pass it through shortcode?

    You can use #sidebar .wp-polls to target your wp-polls on your sidebar and .post-content .wp-polls to target the polls in your post content?

    The shortcode is line 737

    Ok thanks for the reply, but if I use the tinymce shortcode like this:
    [poll id="12"]

    Where I can add this classes? I need to add a specific css to all the poll and the poll’s questions like this (I wrote my custom class in upper case):

    <div id="polls-12" class="wp-polls MY-CUSTOM-POLL-POST-CLASS">
    	<form id="polls_form_12" class="wp-polls-form" action="/index.php/prueba/" method="post">
    		<p style="display: none;"><input type="hidden" id="poll_12_nonce" name="wp-polls-nonce" value="649900112a"></p>
    		<p style="display: none;"><input type="hidden" name="poll_id" value="12"></p>
    		<p class="MY-CUSTOM-CLASS-QUESTION" style="text-align: center;"><strong>Top 10 Partido 2</strong></p>
    		<div id="polls-12-ans" class="wp-polls-ans">
    			<ul class="wp-polls-ul">
    				<li><input type="radio" id="poll-answer-39" name="poll_12" value="39"> <label for="poll-answer-39">Equipo 1</label></li>
    				<li><input type="radio" id="poll-answer-40" name="poll_12" value="40"> <label for="poll-answer-40">Equipo 2</label></li>
    		<p style="text-align: center;"><input type="button" name="vote" value="   Vote   " class="Buttons" onclick="poll_vote(12);"></p><p style="text-align: center;"><a href="#ViewPollResults" onclick="poll_result(12); return false;" title="View Results Of This Poll">Ver Resultados</a></p></div>

    I don’t know how to do that. Sorry but I am very confused.

    *Sorry for my english I am spanish and I write a very basic english :S.

    Plugin Author Lester Chan


    Sorry I don’t provide support to modifications to the plugin because the modification you want is not as straightforward. As I mentioned, this can be done via CSS. You do not need to touch the plugin code at all.

    But, if this css classes don’t work? I use it in the file polls-css.css:

    /*my css*/
    .post-content .wp-polls{
    /*my css*/

    Plugin Author Lester Chan


    I am assuming your theme is using .post-content to style the post content area, you will need to check your theme, because I will not know what CSS class it is using.

    You should have started there xD.
    #content-area is in my template. It works, thank you very much :).

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Can I add a class parameter to wp-polls's shortcode?’ is closed to new replies.