Title: Error with citations
Last modified: March 18, 2020

---

# Error with citations

 *  [Manuel Camargo](https://wordpress.org/support/users/sirlouen/)
 * (@sirlouen)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/error-with-citations/)
 * Using this piece of code:
 *     ```
       function wpse66093_no_admin_access() {
           $redirect = home_url( '/' );
           if ( ! ( current_user_can( 'manage_options' ) || current_user_can( 'edit_posts' ) ) )
               exit( wp_redirect( $redirect ) );
       }
       add_action( 'admin_init', 'wpse66093_no_admin_access', 100 );
       ```
   
 * I picked from here:
    [https://wordpress.stackexchange.com/questions/66093/how-to-prevent-access-to-wp-admin-for-certain-user-roles](https://wordpress.stackexchange.com/questions/66093/how-to-prevent-access-to-wp-admin-for-certain-user-roles)
 * (To restrict Admin area accesses)
 * Citations break for guests (it works though for logged in users)
 * Logged in:
 * > [View post on imgur.com](https://imgur.com/Bzlwn8d)
 * Not logged in:
 * > [View post on imgur.com](https://imgur.com/EkyhCJp)
 * The error:
 *     ```
       VM3892:1 Uncaught SyntaxError: Unexpected token < in JSON at position 0
           at JSON.parse (<anonymous>)
           at Function.n.parseJSON (VM3835 jquery.js:4)
           at Function.a.parseJSON (VM3836 jquery-migrate.min.js:2)
           at Object.success (VM3867 zotpress.shortcode.intext.min.js:9)
           at i (VM3835 jquery.js:2)
           at Object.fireWith [as resolveWith] (VM3835 jquery.js:2)
           at x (VM3835 jquery.js:4)
           at XMLHttpRequest.c (VM3835 jquery.js:4)
       ```
   
 * For more information, the JSON that makes the error and it’s trying to parse,
   is the whole HTML output of the site.
 * The main difference, is that in this particular scenario, citations are shown
   with logged in users, while they are not shown for guests (similar case)
 * I’ve set up this example:
    [https://mcamargo.es/test-zotero-elementor-template/](https://mcamargo.es/test-zotero-elementor-template/)

The topic ‘Error with citations’ is closed to new replies.

 * ![](https://ps.w.org/zotpress/assets/icon-256x256.png?rev=1995512)
 * [Zotpress](https://wordpress.org/plugins/zotpress/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/zotpress/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/zotpress/)
 * [Active Topics](https://wordpress.org/support/plugin/zotpress/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/zotpress/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/zotpress/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [Manuel Camargo](https://wordpress.org/support/users/sirlouen/)
 * Last activity: [6 years, 2 months ago](https://wordpress.org/support/topic/error-with-citations/)
 * Status: not resolved