简体   繁体   中英

Fatal error: Cannot redeclare- (previously declared in wordpress plugin

im a php noob trying to use a plugin called featured item slider for wordpress

-when i use shortcode to place it to pages or posts it works fine . - problem is when i try to place it to my template via php include i get this error

(Fatal error: Cannot redeclare featured_options_page() (previously declared in /home/infostar/public_html/wp-content/plugins/featured-item-slider/featured-item-slider.php:36) in /home/infostar/public_html/wp-content/plugins/featured-item-slider/featured-item-slider.php on line 37)

i ve tryed so far include_once when i use it i get no errors but nothing showing require_once again no erros but i plugin not showing get_included_files still no error but nothing showing

i dont think probably including the file functions.php more than once because it works fine when i call it with shortcode

can someone expert help me???

How are you posting the shortcode in the template?

Here is the correct format according to a wordpress support thread. http://wordpress.org/support/topic/short-code-outside-page-or-post

<?php echo do_shortcode('[catlist id=1 numberposts=5)]'); ?>

The actual shortcode goes in with the square brackets.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM