Beschreibung
WP-Polls is extremely customizable via templates and css styles and there are tons of options for you to choose to ensure that WP-Polls runs the way you wanted. It now supports multiple selection of answers.
Entwicklung
https://github.com/lesterchan/wp-polls
Danksagungen
Spenden
I spent most of my free time creating, updating, maintaining and supporting these plugins, if you really love my plugins and could spare me a couple of bucks, I will really appreciate it. If not feel free to use it without any obligations.
Screenshots
FAQ
-
Allgemeine Verwendung (ohne Widget)
-
<?php if ( function_exists( 'vote_poll' ) && ! in_pollarchive() ): ?> <li> <h2>Polls</h2> <ul> <li><?php get_poll();?></li> </ul> <?php display_polls_archive_link(); ?> </li> <?php endif; ?>
- To show specific poll, use
<?php get_poll(2); ?>
where 2 is your poll id. - To show random poll, use
<?php get_poll(-2); ?>
- To embed a specific poll in your post, use
[poll id="2"]
where 2 is your poll id. - To embed a random poll in your post, use
[poll id="-2"]
- To embed a specific poll’s result in your post, use
[poll id="2" type="result"]
where 2 is your poll id.
- To show specific poll, use
-
Allgemeine Verwendung (mit Widget)
-
- Gehe zu
WordPress-Dashboard -> Design -> Widgets
. - Du kannst das Umfragen-Widget hinzufügen, indem du auf den Link „Hinzufügen“ daneben klickst.
- After adding, you can configure the Polls Widget by clicking on the ‚Edit‘ link besides it.
- Klicke auf „Änderungen speichern“.
- Scroll down for instructions on how to create a Polls Archive.
- Gehe zu
-
Wie fügt man ein Umfragearchiv hinzu?
-
- Go to
WP-Admin -> Pages -> Add New
. - Gib einen beliebigen Titel in den Titelbereich des Beitrags ein.
- If you ARE using nice permalinks, after typing the title, WordPress will generate the permalink to the page. You will see an ‚Edit‘ link just beside the permalink.
- Click ‚Edit‘ and type in
pollsarchive
in the text field and click ‚Save‘. - Gib
[page_polls]
in den Inhaltsbereich des Beitrags ein. - Klicke auf „Veröffentlichen“.
- If you ARE NOT using nice permalinks, you need to go to
WP-Admin -> Polls -> Poll Options
and underPoll Archive -> Polls Archive URL
, you need to fill in the URL to the Polls Archive Page you created above.
- Go to
-
Why doesn’t my poll’s answers add up to 100%?
-
- It is because of rounding issues. To make it always round up to 100%, the last poll’s answer will get the remainding percentage added to it. To enable this feature, add this to your theme’s functions.php:
add_filter( 'wp_polls_round_percentage', '__return_true' );
- It is because of rounding issues. To make it always round up to 100%, the last poll’s answer will get the remainding percentage added to it. To enable this feature, add this to your theme’s functions.php:
-
Wie lädt WP-Polls CSS?
-
- WP-Polls lädt
polls-css.css
aus dem Verzeichnis deines Themes, wenn es existiert. - If it doesn’t exists, it will just load the default
polls-css.css
that comes with WP-Polls. - This will allow you to upgrade WP-Polls without worrying about overwriting your polls styles that you have created.
- WP-Polls lädt
-
Warum erscheint der Text der Umfrage im Internet Explorer (IE) gezackt?
-
- Um dieses Problem zu lösen, öffne poll-css.css
- Finde:
/* background-color: #ffffff; */
- Ersetze:
background-color: #ffffff;
(wobei #ffffff deine Hintergrundfarbe für die Umfrage sein sollte).
-
How Do I Have Individual Colors For Each Poll’s Bar?
-
- Mit freundlicher Genehmigung von TreedBox.com
- poll-css.css öffnen
- Am Ende der Datei hinzufügen:
.wp-polls-ul li:nth-child(01) .pollbar{ background:#8FA0C5} .wp-polls-ul li:nth-child(02) .pollbar{ background:#FF8} .wp-polls-ul li:nth-child(03) .pollbar{ background:#ff8a3b} .wp-polls-ul li:nth-child(04) .pollbar{ background:#a61e2a} .wp-polls-ul li:nth-child(05) .pollbar{ background:#4ebbff} .wp-polls-ul li:nth-child(06) .pollbar{ background:#fbca54} .wp-polls-ul li:nth-child(07) .pollbar{ background:#aad34f} .wp-polls-ul li:nth-child(08) .pollbar{ background:#66cc9a} .wp-polls-ul li:nth-child(09) .pollbar{ background:#98CBCB} .wp-polls-ul li:nth-child(10) .pollbar{ background:#a67c52} .wp-polls-ul li .pollbar{ transition: background 0.7s ease-in-out } .wp-polls-ul li .pollbar:hover{ background:#F00 }
-
So zeigst du die Gesamtzahl der Umfragen an
-
<?php if ( function_exists( 'get_pollquestions' ) ): ?> <?php get_pollquestions(); ?> <?php endif; ?>
-
So zeigst du die gesamten Umfrageantworten an
-
<?php if ( function_exists( 'get_pollanswers' ) ): ?> <?php get_pollanswers(); ?> <?php endif; ?>
-
So zeigst du die Gesamtzahl der Stimmen an
-
<?php if ( function_exists( 'get_pollvotes' ) ): ?> <?php get_pollvotes(); ?> <?php endif; ?>
-
So zeigst du die Umfragestimmen nach ID an
-
<?php if ( function_exists( 'get_pollvotes_by_id' ) ): ?> <?php get_pollvotes_by_id($poll_id); ?> <?php endif; ?>
-
So zeigst du die Gesamtzahl der Umfrageteilnehmer an
-
<?php if ( function_exists( 'get_pollvoters' ) ): ?> <?php get_pollvoters(); ?> <?php endif; ?>
-
So zeigst du die Umfragezeit nach ID und Datumsformat an
-
<?php if ( function_exists( 'get_polltime' ) ): ?> <?php get_polltime( $poll_id, $date_format ); ?> <?php endif; ?>
-
Übersetzen des Templates
-
The plugin templates can be translated via template variables.
There are these filters for the custom template variableswp_polls_template_votebody_variables wp_polls_template_votefooter wp_polls_template_resultheader_variables wp_polls_template_resultbody_variables wp_polls_template_resultfooter_variables
Add filter to your theme and register custom variable where you will add your translation.
Good practice is to name them for example with prefixSTR_
in the exampleSTR_TOTAL_VOTERS
./** * Localize wp_polls_template_resultfooter_variables. * * @param array $variables An array of template variables. * @return array $variables Modified template variables. */ function wp_polls_template_resultfooter_variables( $variables ) { // Add strings. $variables['%STR_TOTAL_VOTERS%'] = __( 'Total voters', 'theme-textdomain' ); return $variables; } // Trigger the filter add_filter( 'wp_polls_template_resultfooter_variables', 'wp_polls_template_resultfooter_variables' , 10, 1 );
In the admin side just call the custom variable like so and the variable has been translated in the front-end.
%STR_TOTAL_VOTERS%‘
Rezensionen
Mitwirkende & Entwickler
„WP-Polls“ ist Open-Source-Software. Folgende Menschen haben an diesem Plugin mitgewirkt:
Mitwirkende„WP-Polls“ wurde in 15 Sprachen übersetzt. Danke an die Übersetzerinnen und Übersetzer für ihre Mitwirkung.
Übersetze „WP-Polls“ in deine Sprache.
Interessiert an der Entwicklung?
Durchstöbere den Code, sieh dir das SVN Repository an oder abonniere das Entwicklungsprotokoll per RSS.
Änderungsprotokoll
Version 2.77.2
- FIXED: Read from default REMOTE_ADDR unless specified in options
Version 2.77.1
- FIXED: Support mutex lock for multi-site. Props @yrkmann.
Version 2.77.0
- NEW: Use mutex lock to prevent race condition.
Version 2.76.0
- NEW: Supports specifying which header to read the user’s IP from. Props Marc Montpas.
Version 2.75.6
- NEW: New filter for template variables: wp_polls_template_votebody_variables, wp_polls_template_votefooter, wp_polls_template_resultheader_variables, wp_polls_template_resultbody_variables, wp_polls_template_resultfooter_variables. Props @Liblastic.
- NEU: composer.json
- FIXED: Missing space for check_voted_username MySQL query
Version 2.75.5
- NEW: New filter for templates: wp_polls_template_resultheader_markup, wp_polls_template_resultbody_markup, wp_polls_template_resultbody2_markup, wp_polls_template_resultfooter_markup, wp_polls_template_resultfooter2_markup. Props @Jaska.
Version 2.75.4
- FIXED: Unable to edit poll because of class-wp-block-parser.php.
Version 2.75.3
- FIXED: Broken filter for templates
- FIXED: Divison by 0 by totalvoters
- FIXED: Add whitelist to sortby poll answers
Versiob 2.75.2
- FIXED: Missing str_replace for wp_polls_template filter
Version 2.75.1
- FIXED: Use array() instead of [] as a few users are still on < PHP 5.4. Props @bearlydoug.
- FIXED: pollq_expiry is now 0 instead of blank string. Props @hpiirainen.
Version 2.75
- FIXED: Standardize all filters to begin with
wp_polls
rather thanpoll
- NEW: Added
wp_polls_ipaddress
andwp_polls_hostname
to allow user to overwrite it.
Version 2.74.1
- FIXED: Don’t use PHP 5.4 Short array syntax.
- BEHOBEN: Division durch Null
- FIXED: Wrong database column type for pollq_expiry
Version 2.74
- NEW: Hashed IP and anonymize Hostname to make it GDPR compliance
- NEW: If Do Not Log is set in Poll Options, do not log to DB
- NEW: Support %POLL_MULTIPLE_ANSWER_PERCENTAGE%. This is total votes divided by total voters.
Version 2.73.8
- FIXED: Bug fixes and stricter type checking
Version 2.73.7
- FIXED: Unable to save input HTML tags for footer templates
Version 2.73.6
- FIXED: Unable to vote for multiple answers
- FIXED: input HTML tags being removed when saving templates
Version 2.73.5
- BEHOBEN: Parsed-Fehler in SERVER-Variable.
Version 2.73.4
- BEHOBEN: sanitize_key über intval.
Version 2.73.3
- NEW: Added sort by votes casted to poll answers.
- NEW: For polls with mutiple answers, we divided by total votes instead of total voters. Props @ljxprime.
- FIXED: Do not display poll option is not respected when poll is closed.
- FIXED: pollip_qid, pollip_aid, pollip_timestamp are now int(10) in pollsip table.
- FIXED: pollq_expiry is now int(10) in pollsq table.
Version 2.73.2
- NEU: Auf WordPress 4.7 erhöht
- FIXED: Change cron to hourly instead of twice daily.
Version 2.73.1
- BEHOBEN: Lokale IP zulassen
- FIXED: XSS on Poll bar option. Props Netsparker Web Application Security Scanner
- BEHOBEN: Strengere Überprüfung von Umfrageoptionen
Version 2.73
- NEW: Display Poll Questions at the top of the Poll Logs table
- BEHOBEN: Schrägstriche entfernt
Version 2.72
- NEU: Verwendung von translate.wordpress.org, um das Plugin zu übersetzen
- BEHOBEN: SQL-Injection behoben. Dank an Jay Dansand
- FIXED: Use $wpdb->insert(), $wpdb->update() and $wpdb->delete() as much as possible
- FIXED Remove poll_archive_show option from UI
Version 2.71
- BEHOBEN: Verwendung von wp_kses_post(), um schlechte Tags immer zu filtern
Version 2.70
- NEU: Action-Hook wp_polls_vote_poll_success hinzugefügt
- NEU: Action-Hooks wp_polls_add_poll, wp_polls_update_poll, wp_polls_delete_poll hinzugefügt
- BEHOBEN: PHP-Hinweise
- BEHOBEN: Nicht benötigte wp_print_scripts entfernt
- FIXED: Use esc_attr() and esc_textarea() instead of htmlspecialchars(). Props Govind Singh