1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.4 Is there away to load css and js files on index.php or / page?

Discussion in 'Styling and Customization Questions' started by GazCBG, Aug 5, 2015.

  1. GazCBG

    GazCBG Member


    I was wondering if there away for me to include some css and js files, but only on the index.php or / page?
  2. Chris D

    Chris D XenForo Developer Staff Member

    Edit the content templates responsible for those pages, e.g. forum_list and use <xen:require css or <xen:require js to call your CSS or JS as appropriate. In this case the CSS would need to be templates you create containing your CSS in the Admin CP.

    Another route is:

    <xen:container var="$head.myCode">Your code here</xen:container>
    Again add something like that to the forum_list template and it will be added to the header only on the index page.
    GazCBG likes this.

Share This Page