Support » Plugin: Testimonials Widget » w3c validation

  • Resolved itelio



    I have a w3c validation problem.

    “Element p not allowed as child of element q in this context”.

    The code is like this:
    </span><q><p><span class=”open-quote”></span>

    I checked each plugin file and I couldn’t find a way to remove the p tags. Only the q tags but it looks bad without them.

    I hope somebody can help.

    Thank you.


Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Michael Cannon


    Upgrade to latest Testimonials Widget version and don’t check the “Use q tag” option.


    Thank you for your fast reply.

    I did that and the widget looks really bad if I deactivate the q tag.

    If I deactivate the q tag, the background is different, the font is bigger, the padding is bigger.

    Is there a way to simply remove the p tag?

    Thank you.

    Regards, Alin!

    Plugin Author Michael Cannon


    if it looks really bad, then update your CSS to style the blockquote and tag than the q.

    If you want to remove, read the FAQ on using filters to alter the output.


    Thank you for your reply. I read the FAQs and for some reasons, I found nothing related to <p> tag.

    add_filter( ‘testimonials_widget_get_testimonial_html’, ‘my_testimonials_widget_get_testimonial_html’, 10, 13 );

    function my_testimonials_widget_get_testimonial_html( $html, $testimonial, $atts, $is_list, $is_first, $widget_number, $div_open, $image, $quote, $cite, $extra, $bottom-text, $div_close ) {
    // do stuff… see Testimonials_Widget::get_testimonials_html for default processing
    if ( is_page( 437 ) ) {
    $source = ”;
    if ( ! empty( $testimonial[‘testimonial_source’] ) )
    $source = ‘<h3>’ . $testimonial[‘testimonial_source’] . ‘</h3>’;

    $html = $div_open
    . $source
    . $image
    . $quote
    // . $cite
    // . $extra
    // . $bottom-text
    . $div_close;
    return $html;
    } elseif ( false && $is_list ) {
    return ‘

  • ‘ . $image . $testimonial[‘testimonial_title’] . ‘
  • ‘;
    } else {
    return $html;

    You can filter almost everything but the <p> tag which I think it’s useless in the code.

    Maybe you know a trick.

    Thank you.

    Regards, AG

Plugin Author Michael Cannon



The p tag comes from wpautop. Have you tried unchecking “Keep whitespace?” option or using keep_whitespace=false in your shortcode?

Hi, Michael!

It worked. 🙂

I unchecked “keep whitespace” and it’s valid now.

Thank you very much for your excellent support.

Have a nice day.

Regards, Alin!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘w3c validation’ is closed to new replies.