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

Specular: php codeing not executing

php
    • 9 years, 11 months ago rlambertiv
      Participant

      Expired

      Greetings:

       

      I have tried to execute php code on a web page:  <span style=”color: #000000; font-family: Times New Roman; font-size: medium;”>https://ezcabin.com/search-plans/ and it just echos back the code.  I have two plugins installed that I have used in other themes to allow php code to be executed (1) Php Code for Posts and (2) Php Execution.  </span>

       

      Also I have created a shortcodes.php file in the specular folder and I have added the following code to the end of the functions-specular.php file:

       

      /**
      *  custom php shortcodes for NEH Home Plan Search
      */
      require_once(‘shortcodes.php’);

       

      Thank You

      Jack

       

       

       

    • 9 years, 11 months ago Mirela
      Participant

      Hello,

      We haven’t tested theme with these two plugins. As for the php code, you should add it to the functions.php file instead.

      Best regards!

    • 9 years, 11 months ago rlambertiv
      Participant

      Expired

      I have deactivated the two plugins (1) Php code for Posts and (2) Php Execution.  Now, on the home page  https://ezcabin,com  I have placed <?php echo “Hello World on Home Page”?> before any other copy and when you go to https://ezcabin.com, the php code is shown and is not being ececuted.

      What do I have to do to get this theme to process php code????

       

      Thank You

    • 9 years, 11 months ago Mirela
      Participant

      Hello,

      You can add and execute php code in all php theme files. As i previously wrote, add php code for shortcodes into functions.php file. Adding it directly to page is not the correct way.
      If you must test it like this, then add the line into page.php file.

      Best regards!

    • 9 years, 11 months ago rlambertiv
      Participant

      Expired

      I have created a shortcodes.php file in the specular theme folder and I have added the following code to the end of the functions.php file as you instructed:

      /**
      * custom php shortcodes for NEH Home Plan Search
      */
      require_once(‘shortcodes.php’);

      In the shortcodes.php, I have this function:

      function RetrieveSearchParameterOptions () {
      …
      …
      …
      }
      add_shortcode(‘retrieve-search-parameter-options’, ‘RetrieveSearchParameterOptions’);

      Now, I want to execute this function on only one particular web page https://ezcabin.com/search-plans/ In other themes, I just had to place the shortcode [‘retrieve-search-parameter-options’] in the web page and it would execute the function. Or I could place <?php echo do_shortcode(‘[retrieve-search-perameter-options]’); ?> and it would execute the code.

      How can I place this shortcode in the specular theme pages.php file and it execute only on the search-plan web page???

      Thank You

    • 9 years, 11 months ago Mirela
      Participant

      Hello,

      You can add new shortcode code in file \includes\register\register_shortcodes.php. Look at other existing shortcodes for example. Then add it’s file in \includes\core\shortcodes\sc folder. You’ll find it with other shortcodes in text editor. So you can use it where ever you want.

      Best regards!

Viewing 5 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