WordPress.org

Ready to get started?Download WordPress

Forums

WP Easy Post Types
Causes Stylesheet and Javascript problems (6 posts)

  1. pencilneck
    Member
    Posted 4 years ago #

    Lot's of extra style sheets and javascript calls are made, including ON THE PUBLIC side of the website, and the path to them is incorrect. The css/js should only be enqueued on the admin side.

    In order to get the Chrome console to stop throwing errors at me, I had to comment out all the places where the js/css was enqueued.

  2. figcar
    Member
    Posted 4 years ago #

    I noticed this too. To keep the JS/CSS off my public pages, I wrapped every case in

    if (is_admin()) {
    [....SOME CODE WITH wp_enqueue_script OR wp_enqueue_style....]
    }

    The following six files were affected:

    • easy-post-types/classes/custom-checkbox/custom-checkbox.php
    • easy-post-types/classes/custom-datefield/custom-datefield.php
    • easy-post-types/classes/custom-image/custom-image.php
      easy-post-types/classes/custom-select/custom-select.php
    • easy-post-types/classes/custom-textfield/custom-textfield.php
    • easy-post-types/custom-type.php

    This succeeded in removing the JS/CSS from public pages but leaving it present on the Admin side.

  3. pencilneck
    Member
    Posted 4 years ago #

    Thanks figcar, that's what I ended up doing too.

  4. ocorral
    Member
    Posted 3 years ago #

    I noticed this as well. all of those are getting loaded on the public side for no reason.

  5. mccormicky
    Member
    Posted 3 years ago #

    Opera will not load Cufon if there is even 1 empty or 404 stylesheet & with easy post types activated there are 5 stylesheets included with the wrong path.
    If you need to Fix this(all other browsers seem to be more forgiving about this), FTP to wp-content/plugins/easy-post-types/classes

    You have to edit each file listed here:
    custom-checkbox/custom-checkbox.php
    custom-checkbox/custom-datefield.php
    custom-checkbox/custom-image.php
    custom-checkbox/custom-select.php
    custom-checkbox/custom-textfield.php
    In each file you find this line(Sorry Line # are not the same):
    wp_enqueue_style($this->getId().'-style', $this->root. 'style.css');

    Change it to

    wp_enqueue_style($this->getId().'-style', $this->httpRoot. 'style.css');

    The author defines root and httpRoot

    $this->root=dirname(__FILE__).'/';
            $this->httpRoot = plugins_url( '', __FILE__).'/';

    I opened the main plugin file custom-type.php
    and noticed scripts were included correctly if using httpRoot
    so I put 2 and 2 together.

    Now Opera loads Cufon.

  6. cerupcat
    Member
    Posted 3 years ago #

    Thanks figcar! This should definitely be included in the next release.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic