Codeless
  • Support Home
  • Themes
  • Support
  • WordPress Tutorials
    • How to Start a Blog
    • Best Website Builders
    • Best Small Business Hosting
    • Email Marketing Services
    • Cheap WordPress Hosting
  • Video Tutorials

Community Forums

PHP Error When Using Center Alignment

    • 6 years ago chriswec
      Participant

      Hello,

      When I try to use the center alignment setting in the media element, I get the following error.

      Warning: A non-numeric value encountered in /home/colouroasis/public_html/wp-content/themes/specular/vc_templates/media.php on line 22

      The error doesn’t occur in left or right alignment, only when centered.

      We are running the latest version 3.1.3.

      -Chris

       

       

       

      • This topic was modified 6 years ago by chriswec.
      • This topic was modified 6 years ago by chriswec.
      • This topic was modified 6 years ago by chriswec.
    • 6 years ago Ludjon
      Keymaster

      Hello,

      It’s just a warning message caused by a High Strict level of error logging. Try to change WP_DEBUG to false, if this not helping, open the media.php file and on line 22
      replace with:

      $width_style = 'style="width:'.(int) $width.'px;position:relative; left:50%; margin-left:-'.((int) $width/2).'px;" ';

      Let me know if this helps you

      Thanks

    • 6 years ago chriswec
      Participant

      Hello,

      That did not help.

      WP_DEBUB was already set to false.

      I tried replacing the php code.  After changing it, when setting the images to center, after saving, the image completely disappears as does the media element it was in.

      -Chris

       

      • This reply was modified 6 years ago by chriswec.
    • 6 years ago Ludjon
      Keymaster

      Hello,

      Just tried directly in your website, you can fix the issue by setting a Width after switch to Center. For example on one of your homepage images I set width to 300

      It works now, let me know if this helps

      Thanks

Viewing 3 reply threads

You must be logged in to reply to this topic.

Login

Log In
Register

Renew Support

  • Renew Specular Support
  • Renew Tower Support
  • Renew Folie Support
  • Renew Handel Support
  • Renew June Support
  • Renew Picante Support
  • Renew Thype Support
  • Renew Regn Support

Search Forums

Forums

  • Bygge – Construction Theme
  • Converta – Software Theme
  • Folie – The WordPress Website Builder
  • Handel – Responsive Multi-Purpose Business Theme
  • June WooCommerce WordPress Theme
  • Livecast – Podcast Theme
  • Picante – Restaurant & Food WordPress Theme
  • Regn | Agency & Business WordPress Theme
  • Remake – Minimal Portfolio & Agency Theme
  • Specular – Multi-Purpose WordPress Theme
  • Suggest us Features
  • Tower – Business-Driven Multipurpose WP Theme
  • Vibrance – Photography Theme

Site Links

  • Support Policy
  • Specular Support Forum
  • Video Tutorials
  • Knowledge Base
  • Guides and Reviews

Useful Articles

  • Build a Website
  • Web Design & Development
  • Hosting
  • WordPress

Login

Log In
Register Lost Password