• Resolved qwazzy

    (@qwazzy)


    I have a slideshow view, I want to change a background color of testimonial slides from transparent to white, but the changes that I do in the View in wp admin do not apply to my custom theme. When I use any wp theme, e.g. storefront, the changes apply successfully.

    In my custom theme template I call testimonials short code like this:
    <?php echo do_shortcode('[testimonial_view id=1]'); ?>

    Everything works fine, except for that changes in the backround color do no apply.

    I noticed that when I use storefrom theme, a style tag for testimonials plugin appears with the style for the background color:

    <style id='wpmtst-custom-style-inline-css' type='text/css'>
        .strong-view-id-1 .testimonial-inner { background: #ff1616; }
    </style>

    However, this tag is absent when I use my custom theme.

Viewing 5 replies - 1 through 5 (of 5 total)
  • anonymized-13171256

    (@anonymized-13171256)

    1. Use this template function instead of do_shortcode:

    <?php if ( function_exists( 'strong_testimonials_view' ) ) { strong_testimonials_view( 1 ); } ?>

    2. Does your theme call wp_footer?
    https://codex.ww.wp.xz.cn/Function_Reference/wp_footer

    Thread Starter qwazzy

    (@qwazzy)

    Yes, I do use wp_footer(), the layout and functionality of testimonials works fines, I only have issue with the background color, for some reason that inline style is not being applied.

    I replaced shortcode with the function you provided. However, everything is still the same. May be the plugin applies inline style through some function that I lack in my custom template? It is based on underscores starter theme, and included header and footer functions. May be I should add something into functions.php?

    anonymized-13171256

    (@anonymized-13171256)

    You’ve found a shortcoming of the template function approach. The plugin uses the WP built-in function for adding custom style but that is called before the background style is added.

    I will try to find a workaround for the next update.

    Meanwhile, I suggest adding the view background style to your theme stylesheet directly.

    Thread Starter qwazzy

    (@qwazzy)

    Meanwhile, I suggest adding the view background style to your theme stylesheet directly.

    Yep, that’s what I did. Thank you for the response. I also want to take this opportunity to thank you for this excellent plugin, I love it.

    anonymized-13171256

    (@anonymized-13171256)

    Cool, thanks!

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘View background does not apply in custom template’ is closed to new replies.