WordPress.org

Ready to get started?Download WordPress

Forums

Testimonials by Aihrus
[resolved] w3c validation (7 posts)

  1. itelio
    Member
    Posted 1 year ago #

    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/

  2. Michael Cannon
    Member
    Plugin Author

    Posted 1 year ago #

    Upgrade to latest Testimonials Widget version and don't check the "Use q tag" option.

  3. itelio
    Member
    Posted 1 year ago #

    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!

  4. Michael Cannon
    Member
    Plugin Author

    Posted 1 year ago #

    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.

  5. itelio
    Member
    Posted 1 year ago #

    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 '

  6. ' . $image . $testimonial['testimonial_title'] . '
  7. ';
    } 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

  • Michael Cannon
    Member
    Plugin Author

    Posted 1 year ago #

    Alin,

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

  • itelio
    Member
    Posted 1 year ago #

    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!

  • Topic Closed

    This topic has been closed to new replies.

    About this Plugin

    About this Topic

    Tags

    No tags yet.