-3

That Doesn't work . Check Out ThIS !! i Have exactly same Problem . . how to add Wordpress phpshortcode into HTML page or custom template?

for sure it's php error .i wanna ad this Shortcode [<?php echo do_shortcode('[wpdreams_ajaxsearchlite] '); ?> ] to my custom html template , so for this, i have to change my html based template to a php based and while changin html to php !!

i got this error !!

Parse error: syntax error, unexpected 'camera' (T_STRING), expecting ',' or ';' on line 205

and 2nd line in below code is line 205

<ul id="nav">






<li><a href="javascript:goTo('camera');"><i class="fa fa-home"></i><p><span style="color: #ffffff;"><strong>Home</strong></span></p></a></li>

     <li><a href="javascript:goTo('Movies');"><i class="fa fa-film" ></i><p><span style="color: #ffffff;"><strong>Movies</strong></span></p></a></li>



     <li><a href="javascript:goTo('TVshow');"><i class="fa fa-television"></i><p><span style="color: #ffffff;"><strong>TV.Show</strong></span></p></a></li>
     <li><a href="javascript:goTo('Filter');"><i class="fa fa-filter"></i><p><span style="color: #ffffff;"><strong>Filter</strong></span></p></a></li>
     <li><a href="javascript:goTo('Contact');"><i class="fa fa-envelope"></i><p><span style="color: #ffffff;"><strong>Contact</strong></span></p></a></li>
    </ul>
v wake
  • 9
  • 1
  • That looks like a PHP error message... – David Apr 20 '17 at 18:25
  • 1
    As for those who downvoted this, it would be useful to give feedback so the OP can learn why it was voted down and how to improve his question. – Dale Apr 20 '17 at 18:40

1 Answers1

0

This error it's from php please post ful code so I can fix it for you , you probally forgot a string contatenation or a

;

or

}

in the end of your file or function

It can also be a javascript problem change your code to this and let's see how it works

<ul id="nav">
<li><a href="javascript:goTo('camera')"><i class="fa fa-home"></i><p><span style="color: #ffffff;"><strong>Home</strong></span></p></a></li>

 <li><a href="javascript:goTo('Movies')"><i class="fa fa-film" ></i><p><span style="color: #ffffff;"><strong>Movies</strong></span></p></a></li>



 <li><a href="javascript:goTo('TVshow')"><i class="fa fa-television"></i><p><span style="color: #ffffff;"><strong>TV.Show</strong></span></p></a></li>
 <li><a href="javascript:goTo('Filter')"><i class="fa fa-filter"></i><p><span style="color: #ffffff;"><strong>Filter</strong></span></p></a></li>
 <li><a href="javascript:goTo('Contact')"><i class="fa fa-envelope"></i><p><span style="color: #ffffff;"><strong>Contact</strong></span></p></a></li>
</ul>

change your php to this

<?php require( '../wp-load.php' ); ?>
<!DOCTYPE html>
<html>
    <head> 
    </head> 
    <body>  
    <ul id="nav"> <li><a href="javascript:goTo('camera');">
    <i class="fa fa-home"></i>
    <p><span style="color: #ffffff;"><strong>Home</strong></span></p></a></li> </ul> 
    <?php echo do_shortcode('[wpdreams_ajaxsearchlite]'); ?>
</body> 
</html>

and change your shortcode to with no blank sapaces

It's right this way <?php echo do_shortcode('[wpdreams_ajaxsearchlite]'); ?>

Otávio Barreto
  • 1,536
  • 3
  • 16
  • 35
  • see my changes if it does solve your problem please mark answer as right – Otávio Barreto Apr 20 '17 at 19:01
  • no bro !! That Doesn't work . But Thanks ya response at least Check Out The Link Below !! i Have exactly same Problem .. https://stackoverflow.com/questions/43535291/how-to-add-wordpress-phpshortcode-into-html-page-or-custom-template – v wake Apr 21 '17 at 06:45
  • Could you send all the files for me to see it whats is wrong? – Otávio Barreto Apr 21 '17 at 17:34
  • Hey I please change your short code to so no blank spaces – Otávio Barreto Apr 21 '17 at 18:04
  • your code working but not rendering the search bar properly . **Check this [Link](http://movieeater.com/wp-content/420.php) ,This what happen after inserting ur code**. And **check this [Link](http://movieeater.com) _u can see red color search bar on this link_ thats how i want the search bar on 1st Link**. Hope u understand. And if u need file or if ya help on teamviewer contact me *madyvwake@gmail.com* – v wake Apr 22 '17 at 05:52
  • It looks to be a problem with your css send both files to download I will check – Otávio Barreto Apr 24 '17 at 13:08