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 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度
  • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测