• hello,

    if in a custom archive page in my child theme I use this shortcode:

    echo do_shortcode('[a-z-listing display="posts" post-type="custom-post-type"]');
    the the CSS file is missing.

    <link rel='stylesheet' id='a-z-listing-css' href='https://www.mywebsite.tld/wp-content/plugins/a-z-listing/css/a-z-listing-default.css?ver=5.6' type='text/css' media='all' />

    best regards
    Nexus

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Dani Llewellyn

    (@diddledani)

    Hi,

    This is due to the way the plugin detects with has_shortcode() whether the current post/page has the shortcode embedded in it’s content. As you’re calling the shortcode programmatically the detection fails. The good news is there is a simple workaround. Add the following to your theme/child-theme’s functions.php to load the CSS on every page:

    add_action( 'init', 'a_z_listing_force_enable_styles' );
    
    Thread Starter nexusfred

    (@nexusfred)

    Amazing, you have planned everything.

    Thanks a lot!!

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘CSS file missing in a custom archive page’ is closed to new replies.