开发者

Wordpress plugin - How off my plugin in wordpress home page

I made simple plugin and i would like to work this plugin only below full posts but not in home page. Plugin only read images from my database and put images below posts.

   function get_image_big() 

   {             
     echo file_get_contents('http://demotivators.us/widget/big_demotivators.php');        
   }

   add_action( 'loop_end', 'get_image_big');

How off this script in wordpress home page in all themes ? apologize for my englis开发者_开发技巧h.


use is_home() and is_front_page() calls to detect that home page is shown.


You need to add your code to theme templates (whenever you want to show your images). For example, if you want to show your images at the end of single post, you need to add call of your function there. It will looks like this:

if ( function_exists( 'get_image_big' ) ) { get_image_big(); }
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜