• Using WPTouch 3.7.7, also using Rich Text Excerpts plugin

    URL with issue (this is a development/testing site): http://directsupply.awarecreativesolutions.com/locations/south-elgin/

    On the desktop version of the site, I have a Contact Form 7 form displayed in the “sidebar” (it’s not really a true sidebar, more of a div setup in a custom page template. It pulls its content from the Rich Text Excerpts area for the page). The CF7 shortcode is in the “Excerpts” box. I did have to add do_shortcode() code in page.php in order to get the Excerpts plugin to interpret the shortcode instead of just showing the shortcode itself. On desktop, everything looks great.

    However, when I render this page in mobile, instead of displaying the CF7 form, it displays the shortcode for [contact-form-7] instead – but ONLY in the sidebar! As a test, I added the same CF7 shortcode in the regular page content (not the Excerpts box) and that renders fine in mobile through WPTouch.

    I am not sure if this is a WPTouch issue or an Excerpts through WPTouch issue, or something else. I considered buying the premium WPTouch to “Enable Shortcode Handling,” but shortcodes are being handled properly in some instances (like when the shortcode is in the page content box, not the Excerpts box), so I don’t know if that would 100% solve the issue.

    I also tried creating a div to wrap the [contact-form-7] shortcode and added some @ media query styles to hide it on mobile devices, but that didn’t work either (keeps showing up on mobile). I was thinking I could hide the sidebar/excerpt form on mobile and only display the form in the main page content where it’s displaying properly.

    Any suggestions?

    Edit: Still looking for a real solution, but I have a band-aid fix so that things don’t look bad on mobile in the interim. Even though media queries to hide that CF7 form shortcode on mobile devices didn’t work, I was able to add a div COLOR inline style with an Alpha/transparency of 0 and that actually hides the sidebar shortcode text on mobile: <div style=”color:rgba(255, 255, 255, 0);”> The transparency doesn’t seem to effect the form on desktop – the form still shows up.

    • This topic was modified 7 years, 3 months ago by mimicplay. Reason: Added an interim work-around while waiting for a real solution
Viewing 1 replies (of 1 total)
  • Hi,

    With WPtouch Pro, using its child theme feature, you can further and easily customize its templates. For example, you can make use of do_shortcode() in a child theme, in the template of your choice (or with a conditional in page.php) to output the shortcode content.

    However, CF7 shortcodes work without enabling desktop theme shortcode processing, since the plugin is coming from a plugin. So I suspect something else is at play here, likely the rich text excerpts plugin.

    Regards,

    Emilio Rivera
    WPtouch Support

Viewing 1 replies (of 1 total)
  • The topic ‘Contact Form 7 Shortcode Only Works Sometimes’ is closed to new replies.