t2hol Posted February 12, 2015 Share Posted February 12, 2015 Hi experts! I am not a programmer, just a designer and I have problems with php codes, I would like to display a bundle of Wordpress shortcode below on my website but I unable to make it correct, please help me. <?php if ( is_single() ) { echo "<div class="pagelink"><?php wp_link_pages('pagelink=trang %'); ?></div><p>" echo "<div class="fb-like" data-href="https://www.facebook.com/tvvn.net" data-layout="standard" data-action="like" data-show-faces="false" data-share="true"></div><p>" <?php if(function_exists("kk_star_ratings")) : echo kk_star_ratings($pid); endif; ?><p> <?php echo do_shortcode("[kpvc_single]"); ?><p> <?php echo do_shortcode("[fbcomments]"); ?><p> <?php zemanta_related_posts()?> } else {} ?> Each part of the code is correct because it came from the plugin, but I don't known how to make it display at the same place. Could you please help complete Echo etc... the code above. Thanks very much! TOM Quote Link to comment https://forums.phpfreaks.com/topic/294562-please-help-complete-bundle-of-codes/ Share on other sites More sharing options...
t2hol Posted February 13, 2015 Author Share Posted February 13, 2015 No one can help me ? Quote Link to comment https://forums.phpfreaks.com/topic/294562-please-help-complete-bundle-of-codes/#findComment-1505602 Share on other sites More sharing options...
maxxd Posted February 13, 2015 Share Posted February 13, 2015 There are several issues with the code you've posted, actually. First and foremost, your quote nesting is incorrect and you're leaving plaintext strings in the middle of the echo statements. Also, the php open/close tags don't match up in several places. <?php if ( is_single() ) { echo "<div class='pagelink'>".wp_link_pages('pagelink=trang %')."</div><p>"; echo "<div class='fb-like' data-href='https://www.facebook.com/tvvn.net' data-layout='standard' data-action='like' data-show-faces='false' data-share='true'></div><p>"; if(function_exists("kk_star_ratings")){ echo kk_star_ratings($pid); } echo "<p>".do_shortcode("[kpvc_single]"); echo "<p>".do_shortcode("[fbcomments]")."<p>"; zemanta_related_posts(); } else {} ?> This just fixes the syntax errors in the code you posted - there's no logic work done in the above. For instance, I'm not seeing where $pid is being defined, so if it's not done somewhere higher up in the script, you'll get an undefined error assuming that function kk_star_ratings() exists. I'm not familiar with the Zemanta Related Posts plugin, so I don't know if zemanta_related_posts() will display to screen without an explicit echo statement. Quote Link to comment https://forums.phpfreaks.com/topic/294562-please-help-complete-bundle-of-codes/#findComment-1505608 Share on other sites More sharing options...
t2hol Posted February 13, 2015 Author Share Posted February 13, 2015 Thank you for your time, I still get error and I will go to rent a coder now Thanks again for your help! Quote Link to comment https://forums.phpfreaks.com/topic/294562-please-help-complete-bundle-of-codes/#findComment-1505624 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.