• Resolved itelio

    (@itelio)


    Hi!

    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.

    AG

    http://wordpress.org/extend/plugins/testimonials-widget/

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

    (@comprock)

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

    Thread Starter itelio

    (@itelio)

    Hi!

    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 Contributor Michael Cannon

    (@comprock)

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

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

    Thread Starter itelio

    (@itelio)

    Hi!

    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 Contributor Michael Cannon

    (@comprock)

    Alin,

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

    Thread Starter itelio

    (@itelio)

    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.