duanguai2781 2015-08-03 16:31
浏览 125

如何在wordpress中的front-page.php中正确使用插件

I have created a front-page.php page for my wordpress site. This page contains fully customised css and js. So it doesn't use anything from the installed theme. I am not using:

<?php get_header(); ?>
<?php get_sidebar(); ?>
<?php get_footer(); ?>

Now I have installed a plugin (wp-tiles) and would like to use this on the front-page.php

By adding the code to display the tiles

<?php echo do_shortcode(
        '[wp-tiles post_type = "attachment,product" orderby = "rand" order = "DESC" grids = "Featured" small_screen_grid = "Featured" breakpoint = "800" padding = "5" pagination = "ajax" grid_selector_color = "#444444"]'
    );?>

It tries to show the tiles but does so incorrectly as I'm assuming the plugin css and js is missing.

Is there anyway to automatically add the plugins required files without manually adding the paths to the front-page.php?

Thanks

  • 写回答

1条回答 默认 最新

  • dongqu2863 2015-08-03 17:30
    关注

    As far as I know the only automatic way to load their CSS and JS files would be to allow Wordpress to load the header like normal, however this will load CSS and JS files for all Wordpress plugins and themes which are activated.

    The only other solution I could imagine would be to manually load the paths as you have suggested. You could do this by running a php script to go into their plugin folder and then assets and load each css and js file, however it seems it would be easier just to manually load the paths.

    评论

报告相同问题?

悬赏问题

  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器