• How do I style dynamically generated pages that don’t have any of the theme selectors as a parent?

    This is the HTML of the page:

    flameshot_screenshot

    You can see the stats-head and stats-content selectors, but if I style those in my style sheet, the styles will not be applied.
    I asked around and people just said (including support personnel) that it’s a dynamically generated page so it’s not possible to style it.

    the url looks like this:
    mysite.com/ad-stats/qaI21ThjITSynPxlVIuIVPkDAH3zPbcxb3axlcYnhJjIchuJ/

    so I do have a slug that I could target… but how?

    In WordPress I can just use .page for example as a selector, I mean selectors that are built in WordPress, but in this case I have nothing like that.

    I have given up trying to style elements on this dynamically generated page because I didn’t find any information on how to do it.

    So now I am just trying to apply a single SVG filter to filter the whole page, to gain some kind of control over its colors and appearance, instead of styling its elements.

    But I don’t understand why using the selectors stats-head and stats-content that are in the HTML (and I checked in the dev tools that they do select the whole page, if I would style both) cannot be styled from my style sheet, but they can be styled from the dev tools.

    There is no style sheet defined for these elements in the plugin.
    How do I create and apply a style sheet for such a dynamically generated page so that it would be also plugin update proof?
    Is it usual practice for WP plugin authors to not make a stylesheet or not provide styling possibility for dynamically generated pages?
    But in WP everything is dynamically generated, so I don’t understand why this ad statistics page is more dynamically generated than the rest?

    • This topic was modified 3 years, 1 month ago by berry metal.
    • This topic was modified 3 years, 1 month ago by berry metal.
    • This topic was modified 3 years, 1 month ago by berry metal.
    • This topic was modified 3 years, 1 month ago by berry metal.
    • This topic was modified 3 years, 1 month ago by berry metal.
    • This topic was modified 3 years, 1 month ago by berry metal.
    • This topic was modified 3 years, 1 month ago by Jan Dembowski. Reason: Moved to Fixing WordPress, this is not an Developing with WordPress topic
Viewing 15 replies - 1 through 15 (of 25 total)
  • Moderator bcworkz

    (@bcworkz)

    Dev tool styles have high precedence, which may not be the case with external stylesheets. If you need to override existing styling, ensuring your stylesheet is loaded last is helpful. Inline styles have higher precedence. Again, listing inline styles last is helpful. If the source HTML has its own style attributes, or they are within an iframe, you cannot override those styles.

    You can add styles from your own plugin that would be applied to anything on the site if they have adequate precedence. External stylesheets are loaded by calling wp_enqueue_styles() from within a callback hooked to “wp_enqueue_scripts” action. Adding with a very large $priority argument helps ensure it’s loaded last. Even better would be to list other enqueued styles as dependencies.

    To add inline styles, we normally use wp_add_inline_style(), but to ensure the styles are listed last, you could use the “wp_head” action to directly output a style block. Again, add your callback with a large $priority argument to help ensure it’s listed last.

    Thread Starter berry metal

    (@erikalleman)

    Hi there!

    This is the content of my plugin (MU plugin), of the PHP file that I made:

    add_action( 'wp_enqueue_scripts', function() {
        if ( false !== strpos(  $_SERVER['REQUEST_URI'], 'ad-stats' ) ) {
            wp_enqueue_style( 'ad_stats_styles', '/ads_stats.css' );
        }
    } );

    this is how the link of the page looks:

    mysite.com/ad-stats/qaI21ThjITSynPxlVIuIVPkDAH3zPbcxb3axlcYnhJjIchuJ/

    this is the html of the page:

    flameshot_screenshot

    Could you explain what does “dynamically generated page mean”?
    Because in WordPress everything is dynamically generated, yet I can style everything. So the term “dynamically generated page” can be confusing.
    I was told that this advertisement statistics page cannot be styled because its dynamically generated.

    This is how my style sheets are enqueued in my functions.php:

    function my_load_child_theme_styles() {
    
        if ( ! defined( 'WPEX_THEME_STYLE_HANDLE' ) ) {
            wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css', array(), '1.0' );
        }
    
        // First de-register the main stylesheet (which is now your child theme style.css)
        wp_dequeue_style( WPEX_THEME_STYLE_HANDLE );
        wp_deregister_style( WPEX_THEME_STYLE_HANDLE );
    
        // Add the parent style.css with the main style handle
        wp_enqueue_style( WPEX_THEME_STYLE_HANDLE, get_template_directory_uri() . '/style.css', array(), WPEX_THEME_VERSION );
    
        // Re-add child CSS with parent as dependency
        wp_enqueue_style( 'child-css', get_stylesheet_directory_uri() . '/style.css', array( WPEX_THEME_STYLE_HANDLE ), '1.0' );
    
        wp_enqueue_style(
        'child_media-css', // stylesheet handle
        get_stylesheet_directory_uri() . '/child_media_600_max.css', // stylesheet file URL
        array( WPEX_THEME_STYLE_HANDLE ), // dependencies
        '1.0', // stylesheet version
        'only screen and (max-width:600px)' // media query
    );
    
    wp_enqueue_style(
        'child_media-css', // stylesheet handle
        get_stylesheet_directory_uri() . '/child_media_600_min.css', // stylesheet file URL
        array( WPEX_THEME_STYLE_HANDLE ), // dependencies
        '1.0', // stylesheet version
        'only screen and (min-width:600px)' // media query
    );
    
    }
    add_action( 'wp_enqueue_scripts', 'my_load_child_theme_styles', PHP_INT_MAX );

    so this is how the enqueuing of a style looks:

    wp_enqueue_style(
        'child_media-css', // stylesheet handle
        get_stylesheet_directory_uri() . '/child_media_600_min.css', // stylesheet file URL
        array( WPEX_THEME_STYLE_HANDLE ), // dependencies
        '1.0', // stylesheet version
        'only screen and (min-width:600px)' // media query
    );

    Because my first code didn’t work, I changed it into:

    add_action( 'wp_enqueue_scripts', function() {
        if ( false !== strpos(  $_SERVER['REQUEST_URI'], 'ad-stats' ) ) {
                wp_enqueue_style(
        'child_media-css', // stylesheet handle
        get_stylesheet_directory_uri() . '/ads_stats.css', // stylesheet file URL
        array( WPEX_THEME_STYLE_HANDLE ), // dependencies
        '1.0', // stylesheet version
    
    );
        }
    } );

    to try to integrate my plugin styles into the theme, but it does not work.

    The ad stats page styles don’t have their own style attribute, they have their own style sheet.

    Why wouldn’t it work, if I woud drop a copy of the ads stats stylesheet in my child theme, and I would just modify the copy?

    Why wouldn’t it override the styles?
    I asked about this but nobody recommended me to do that.

    Normally files in the child theme should override the original files.

    After trying both of my code snippets out, I could not see the style appear in the head section of the ad stats page, so they did not get enqueued, so this is not (yet) a specificity issue.

    I have choosen my handle to be “ad_stats_styles”, the handle for my new style sheet can be whatever string I choose, is that correct?

    After this initial testing, how do I determine if wp_add_inline_style() is necessary?

    This is the full HTML of the page:

    <!DOCTYPE html>
    <html lang="en-US" prefix="og: https://ogp.me/ns#">
    <head>
    	<meta charset="UTF-8">
    	<title>https://mysite|Ad Statistics</title>
    	<meta name="robots" content="noindex, nofollow"/>
    	<script type="text/javascript">
    		var AAT_SPINNER_URL = 'https://mysite.com/wp-content/plugins/advanced-ads-tracking/public/assets/images/spinner-2x.gif';
    	</script>
    	<script type="text/javascript" src="https://mysite.com/wp-includes/js/jquery/jquery.js"></script>
    	<script type="text/javascript" src="https://mysite.com/wp-includes/js/jquery/jquery-migrate.min.js"></script>
    	<script type="text/javascript"
    			src="https://mysite.com/wp-content/plugins/advanced-ads-tracking/admin/assets/jqplot/jquery.jqplot.min.js"></script>
    	<script type="text/javascript"
    			src="https://mysite.com/wp-content/plugins/advanced-ads-tracking/admin/assets/jqplot/plugins/jqplot.dateAxisRenderer.min.js"></script>
    	<script type="text/javascript"
    			src="https://mysite.com/wp-content/plugins/advanced-ads-tracking/admin/assets/jqplot/plugins/jqplot.highlighter.min.js"></script>
    	<script type="text/javascript"
    			src="https://mysite.com/wp-content/plugins/advanced-ads-tracking/admin/assets/jqplot/plugins/jqplot.cursor.min.js"></script>
    	<script src="https://mysite.com/wp-content/plugins/advanced-ads-tracking/public/assets/js/dist/public-stats.min.js"></script>	<link rel="stylesheet" href="https://mysite.com/wp-content/plugins/advanced-ads-tracking/admin/assets/jqplot/jquery.jqplot.min.css"/>
    	<link rel="stylesheet" href="https://mysite.com/wp-content/plugins/advanced-ads-tracking/public/assets/css/public-stats.css"/>
    	</head>
    <body>
    <div id="stats-head">
    	<h1 id="stats-title">mysite</h1>
    	<div id="stats-period">
    		<table style="width: 100%;">
    			<tbody>
    			<tr>
    				<td style="width:50%;text-align:center;">
    					<h3 id="ad-title">Statistics for Order #10785</h3>
    				</td>
    				<td style="width:50%;text-align:center;">
    					<form method="get" id="period-form">
    						<label>Period:&nbsp;</label>
    						<select name="period">
    							<option value="last30days"  selected='selected'>last 30 days</option>
    							<option value="lastmonth" >last month</option>
    							<option value="last12months" >last 12 months</option>
    						</select>
    						<input type="submit" class="button button-primary"
    							   value="Load"/>
    					</form>
    				</td>
    			</tr>
    			</tbody>
    		</table>
    	</div>
    </div>
    <div id="stats-content">
    	<script type="text/javascript">
    		var statsGraphOptions = {
    			axes:        {
    				xaxis:  {
    					renderer:     null,
    										tickOptions:  {formatString: '%b%d'},
    										tickInterval: '1 day',
    					min:          ''
    				},
    				yaxis:  {
    					min:         0,
    					max: 10,
    					label:       'impressions',
    					tickOptions: {formatString: '%\'.0f'}
    				},
    				y2axis: {
    					min:         0,
    					max: 10,
    					label:       'clicks',
    					tickOptions: {formatString: '%\'.0f'}
    				}
    			},
    			highlighter: {
    				show: true
    			},
    			cursor:      {
    				show: false
    			},
    			title:       {
    				show: true
    			},
    			series:      [
    				{
    					highlighter:   {
    						formatString: "%s: %'.0f impressions"
    					},
    					lineWidth:     1,
    					markerOptions: {style: 'circle', size: 5},
    					color:         '#f06050',
    					label:         'impressions'
    				}, // impressions
    				{
    					yaxis:         'y2axis',
    					highlighter:   {
    						formatString: "%s: %'.0f clicks"
    					},
    					lineWidth:     2,
    					linePattern:   'dashed',
    					markerOptions: {style: 'filledSquare', size: 5},
    					color:         '#4b5de4',
    					label:         'clicks'
    				} // clicks
    			]
    		};
    		var lines             = [[],[]];
    	</script>
    	<div id="public-stat-graph"></div>
    	<div id="graph-legend">
    		<div class="legend-item">
    			<div id="impr-legend"></div>
    			<span class="legend-text">impressions</span>
    		</div>
    		<div class="legend-item">
    			<div id="click-legend"></div>
    			<span class="legend-text">clicks</span>
    		</div>
    	</div>
    	<hr/>
    	<table id="public-stat-table">
    		<thead>
    		<th>date</th>
    		<th>impressions</th>
    		<th>clicks</th>
    		<th>ctr</th>
    		</thead>
    		<tbody>
    					<tr style="background-color:#f0f0f0;color:#222;font-weight:bold;">
    				<td>Total</td>
    				<td>0</td>
    				<td>0</td>
    				<td>0.00 %</td>
    			</tr>
    				</tbody>
    	</table>
    	<hr/>
    </div>
    </body>
    </html>

    I was told that if the ads and ad statistics plugin is creating files on the server, my plugin for injecting the styles won’t work. It must be creating pages within the context of WordPress. How do I test if it’s creating pages within the context of WordPress?

    This is beyond plugin support (it’s customization), hence I am asking it here.
    But actually I would expect developers to provide a hook for this purpose so that we could enqueue our styles, that we could style these dynamically generated ad stats page. Since I am not a real programmer yet, I don’t know if my expectation is fair…

    Because the ad stats page is part of the plugin, so it must be enabled for styling.

    Is it correct to add PHP_INT_MAX as priotity like this?

    add_action( 'wp_enqueue_scripts' PHP_INT_MAX, function() {
        if ( false !== strpos(  $_SERVER['REQUEST_URI'], 'ad-stats' ) ) {
            wp_enqueue_style( 'ad_stats_styles', '/ads_stats.css' );
        }
    } );

    Thanks for your reply!
    I hope you and your businesses are doing well!

    Moderator bcworkz

    (@bcworkz)

    Yes, “dynamically generated” is ambiguous and non-specific. There are discrepancies between the imgur HTML and what you pasted here, so in this case I think they are injecting content via script, hence “dynamic”. Appropriate styles would still be applied unless the injected content is an iframe.

    If a reference to your stylesheet is not appearing in the page’s HTML, then it was not properly enqueued. Maybe the conditional is not working as expected? Remove the conditional until the file reference appears properly on any page. Pass an empty array for dependencies until you’re sure the file reference appears correctly somewhere on the page. This is just to eliminate possible reasons for something to go wrong. Once the reference appears and its link is correct, then you can focus on the particulars like limiting on which page it appears and where it is listed relative to other styles.

    Do you have WP_DEBUG defined as true? It’s helpful because it’ll flag any silly syntax blunders you may have introduced that aren’t obvious, are not fatal errors, yet adversely impacts what the code does.

    Don’t replicate the entire file with your edits. You could, but it’s redundant and adversely impacts page speed. Copying only the rules you wish to alter will achieve the same thing. If you did replicate the entire file because there are so many changes, you should then dequeue the original file.

    You can use any handle string you like, provided it’s not already in use elsewhere. Using PHP_INT_MAX is possible and a good way to ensure you’re using the largest possible priority value. However, you’ve misplaced it in your example. Priority goes after the callback function.

    You can check for WP context by using your browser’s network developer tool. Open the tool, then request the page. Filter the results for only “Doc” requests. If there’s a request to any existing server file besides your WP installation folder, then at least that part is outside of WP context. Any doc requests that do not physically exist on the server are within the WP context.

    The usual reason to use wp_add_inline_style() is to add styling that involves variables that can only be determined at run time. “Dynamically generated” styling :). Inline styles can help if you’re having trouble achieving proper precedence. For example, if you find you must use the !important modifier in your stylesheet (which should be avoided when possible), often adding an equivalent inline style instead will work.

    It shouldn’t be necessary if styling is properly applied, but as a last resort you could use JavaScript or jQuery to set element style attributes. These will always take precedence unless some other script is also setting style attributes.

    Thread Starter berry metal

    (@erikalleman)

    Hi,
    there is only one doc request, to this url:

    flameshot_screenshot

    Thread Starter berry metal

    (@erikalleman)

    I don’t know if this request is going to the wp install folder or not because I cannot see that in the URL…

    Thread Starter berry metal

    (@erikalleman)

    Is this correct now?
    Do I need the comma before the priority?

    add_action( 'wp_enqueue_scripts', function() {
        if ( false !== strpos(  $_SERVER['REQUEST_URI'], 'ad-stats' ) ) {
                wp_enqueue_style(
        'child_media-css', // stylesheet handle
        get_stylesheet_directory_uri() . '/ads_stats.css', // stylesheet file URL
        array( WPEX_THEME_STYLE_HANDLE ), // dependencies
        '1.0', // stylesheet version
        
    );
        }
    } , PHP_INT_MAX );
    Thread Starter berry metal

    (@erikalleman)

    Or I don’t even need to include any theme code, just like this:

    add_action( 'wp_enqueue_scripts' PHP_INT_MAX, function() {
        if ( false !== strpos(  $_SERVER['REQUEST_URI'], 'ad-stats' ) ) {
            wp_enqueue_style( 'ad_stats_styles', '/ads_stats.css' );
        }
    }, PHP_INT_MAX );
    • This reply was modified 3 years, 1 month ago by berry metal.
    Thread Starter berry metal

    (@erikalleman)

    After turning WP-DEBUG on, these are the errors only, they don’t seem to be anything crucial:

    Deprecated: Method ReflectionParameter::getClass() is deprecated in /home/username/public_html/wp-content/plugins/wp-typography/vendor-scoped/level-2/dice/Dice.php on line 184
    
    Deprecated: Method ReflectionParameter::getClass() is deprecated in /home/username/public_html/wp-content/plugins/wp-typography/vendor-scoped/level-2/dice/Dice.php on line 184
    
    Deprecated: Method ReflectionParameter::getClass() is deprecated in /home/username/public_html/wp-content/plugins/wp-typography/vendor-scoped/level-2/dice/Dice.php on line 184
    
    Deprecated: Method ReflectionParameter::getClass() is deprecated in /home/username/public_html/wp-content/plugins/wp-typography/vendor-scoped/level-2/dice/Dice.php on line 184
    
    Deprecated: Method ReflectionParameter::getClass() is deprecated in /home/username/public_html/wp-content/plugins/wp-typography/vendor-scoped/level-2/dice/Dice.php on line 184
    
    Deprecated: Method ReflectionParameter::getClass() is deprecated in /home/username/public_html/wp-content/plugins/wp-typography/vendor-scoped/level-2/dice/Dice.php on line 184
    
    Deprecated: Method ReflectionParameter::getClass() is deprecated in /home/username/public_html/wp-content/plugins/wp-typography/vendor-scoped/level-2/dice/Dice.php on line 184
    
    Deprecated: Method ReflectionParameter::getClass() is deprecated in /home/username/public_html/wp-content/plugins/wp-typography/vendor-scoped/level-2/dice/Dice.php on line 184
    
    Deprecated: Method ReflectionParameter::getClass() is deprecated in /home/username/public_html/wp-content/plugins/wp-typography/vendor-scoped/level-2/dice/Dice.php on line 184
    
    Deprecated: Method ReflectionParameter::getClass() is deprecated in /home/username/public_html/wp-content/plugins/wp-typography/vendor-scoped/level-2/dice/Dice.php on line 184
    
    Deprecated: Method ReflectionParameter::getClass() is deprecated in /home/username/public_html/wp-content/plugins/wp-typography/vendor-scoped/level-2/dice/Dice.php on line 184
    
    Deprecated: Method ReflectionParameter::getClass() is deprecated in /home/username/public_html/wp-content/plugins/wp-typography/vendor-scoped/level-2/dice/Dice.php on line 184
    
    Deprecated: Method ReflectionParameter::getClass() is deprecated in /home/username/public_html/wp-content/plugins/wp-typography/vendor-scoped/level-2/dice/Dice.php on line 184
    
    Deprecated: Method ReflectionParameter::getClass() is deprecated in /home/username/public_html/wp-content/plugins/wp-typography/vendor-scoped/level-2/dice/Dice.php on line 184
    
    Deprecated: Method ReflectionParameter::getClass() is deprecated in /home/username/public_html/wp-content/plugins/wp-typography/vendor-scoped/level-2/dice/Dice.php on line 184
    
    Deprecated: Method ReflectionParameter::getClass() is deprecated in /home/username/public_html/wp-content/plugins/wp-typography/vendor-scoped/level-2/dice/Dice.php on line 184
    
    Deprecated: Method ReflectionParameter::getClass() is deprecated in /home/username/public_html/wp-content/plugins/wp-typography/vendor-scoped/level-2/dice/Dice.php on line 184
    
    Deprecated: Method ReflectionParameter::getClass() is deprecated in /home/username/public_html/wp-content/plugins/wp-typography/vendor-scoped/level-2/dice/Dice.php on line 184
    
    Deprecated: Method ReflectionParameter::getClass() is deprecated in /home/username/public_html/wp-content/plugins/wp-typography/vendor-scoped/level-2/dice/Dice.php on line 184
    
    Deprecated: Method ReflectionParameter::getClass() is deprecated in /home/username/public_html/wp-content/plugins/wp-typography/vendor-scoped/level-2/dice/Dice.php on line 184
    
    Deprecated: Method ReflectionParameter::getClass() is deprecated in /home/username/public_html/wp-content/plugins/wp-typography/vendor-scoped/level-2/dice/Dice.php on line 184
    
    Deprecated: Method ReflectionParameter::getClass() is deprecated in /home/username/public_html/wp-content/plugins/wp-typography/vendor-scoped/level-2/dice/Dice.php on line 184
    
    Deprecated: Method ReflectionParameter::getClass() is deprecated in /home/username/public_html/wp-content/plugins/wp-typography/vendor-scoped/level-2/dice/Dice.php on line 184
    
    Deprecated: Method ReflectionParameter::getClass() is deprecated in /home/username/public_html/wp-content/plugins/wp-typography/vendor-scoped/level-2/dice/Dice.php on line 184
    
    Deprecated: Method ReflectionParameter::getClass() is deprecated in /home/username/public_html/wp-content/plugins/wp-typography/vendor-scoped/level-2/dice/Dice.php on line 184
    
    Deprecated: Method ReflectionParameter::getClass() is deprecated in /home/username/public_html/wp-content/plugins/wp-typography/vendor-scoped/level-2/dice/Dice.php on line 184
    
    Deprecated: Method ReflectionParameter::getClass() is deprecated in /home/username/public_html/wp-content/plugins/wp-typography/vendor-scoped/level-2/dice/Dice.php on line 184
    
    Deprecated: Method ReflectionParameter::getClass() is deprecated in /home/username/public_html/wp-content/plugins/wp-typography/vendor-scoped/level-2/dice/Dice.php on line 184
    
    Deprecated: Method ReflectionParameter::getClass() is deprecated in /home/username/public_html/wp-content/plugins/wp-typography/vendor-scoped/level-2/dice/Dice.php on line 184
    
    Deprecated: Method ReflectionParameter::getClass() is deprecated in /home/username/public_html/wp-content/plugins/wp-typography/vendor-scoped/level-2/dice/Dice.php on line 184
    
    Deprecated: Method ReflectionParameter::getClass() is deprecated in /home/username/public_html/wp-content/plugins/wp-typography/vendor-scoped/level-2/dice/Dice.php on line 184
    
    Deprecated: Method ReflectionParameter::getClass() is deprecated in /home/username/public_html/wp-content/plugins/wp-typography/vendor-scoped/level-2/dice/Dice.php on line 184
    
    Deprecated: Method ReflectionParameter::getClass() is deprecated in /home/username/public_html/wp-content/plugins/wp-typography/vendor-scoped/level-2/dice/Dice.php on line 184
    
    Deprecated: Method ReflectionParameter::getClass() is deprecated in /home/username/public_html/wp-content/plugins/wp-typography/vendor-scoped/level-2/dice/Dice.php on line 184
    
    Deprecated: Method ReflectionParameter::getClass() is deprecated in /home/username/public_html/wp-content/plugins/wp-typography/vendor-scoped/level-2/dice/Dice.php on line 184
    
    Deprecated: Method ReflectionParameter::getClass() is deprecated in /home/username/public_html/wp-content/plugins/wp-typography/vendor-scoped/level-2/dice/Dice.php on line 184
    
    Deprecated: Method ReflectionParameter::getClass() is deprecated in /home/username/public_html/wp-content/plugins/wp-typography/vendor-scoped/level-2/dice/Dice.php on line 184
    
    Deprecated: Method ReflectionParameter::getClass() is deprecated in /home/username/public_html/wp-content/plugins/wp-typography/vendor-scoped/level-2/dice/Dice.php on line 184
    
    Deprecated: Method ReflectionParameter::getClass() is deprecated in /home/username/public_html/wp-content/plugins/wp-typography/vendor-scoped/level-2/dice/Dice.php on line 184
    
    Deprecated: Method ReflectionParameter::getClass() is deprecated in /home/username/public_html/wp-content/plugins/wp-typography/vendor-scoped/level-2/dice/Dice.php on line 184
    
    Deprecated: Method ReflectionParameter::getClass() is deprecated in /home/username/public_html/wp-content/plugins/wp-typography/vendor-scoped/level-2/dice/Dice.php on line 184
    
    Deprecated: Method ReflectionParameter::getClass() is deprecated in /home/username/public_html/wp-content/plugins/wp-typography/vendor-scoped/level-2/dice/Dice.php on line 184
    
    Deprecated: Method ReflectionParameter::getClass() is deprecated in /home/username/public_html/wp-content/plugins/wp-typography/vendor-scoped/level-2/dice/Dice.php on line 184
    
    Deprecated: Method ReflectionParameter::getClass() is deprecated in /home/username/public_html/wp-content/plugins/wp-typography/vendor-scoped/level-2/dice/Dice.php on line 184
    
    Deprecated: Method ReflectionParameter::getClass() is deprecated in /home/username/public_html/wp-content/plugins/wp-typography/vendor-scoped/level-2/dice/Dice.php on line 184
    
    Deprecated: Method ReflectionParameter::getClass() is deprecated in /home/username/public_html/wp-content/plugins/wp-typography/vendor-scoped/level-2/dice/Dice.php on line 184
    
    Deprecated: Method ReflectionParameter::getClass() is deprecated in /home/username/public_html/wp-content/plugins/wp-typography/vendor-scoped/level-2/dice/Dice.php on line 184
    
    Deprecated: Method ReflectionParameter::getClass() is deprecated in /home/username/public_html/wp-content/plugins/wp-typography/vendor-scoped/level-2/dice/Dice.php on line 184
    
    Deprecated: Method ReflectionParameter::getClass() is deprecated in /home/username/public_html/wp-content/plugins/wp-typography/vendor-scoped/level-2/dice/Dice.php on line 184
    
    Deprecated: Method ReflectionParameter::getClass() is deprecated in /home/username/public_html/wp-content/plugins/wp-typography/vendor-scoped/level-2/dice/Dice.php on line 184
    
    Deprecated: Method ReflectionParameter::getClass() is deprecated in /home/username/public_html/wp-content/plugins/wp-typography/vendor-scoped/level-2/dice/Dice.php on line 184
    
    Deprecated: Method ReflectionParameter::getClass() is deprecated in /home/username/public_html/wp-content/plugins/wp-typography/vendor-scoped/level-2/dice/Dice.php on line 184
    
    Deprecated: Method ReflectionParameter::getClass() is deprecated in /home/username/public_html/wp-content/plugins/wp-typography/vendor-scoped/level-2/dice/Dice.php on line 184
    
    Deprecated: Method ReflectionParameter::getClass() is deprecated in /home/username/public_html/wp-content/plugins/wp-typography/vendor-scoped/level-2/dice/Dice.php on line 184
    
    Deprecated: Method ReflectionParameter::getClass() is deprecated in /home/username/public_html/wp-content/plugins/wp-typography/vendor-scoped/level-2/dice/Dice.php on line 184
    
    Deprecated: Method ReflectionParameter::getClass() is deprecated in /home/username/public_html/wp-content/plugins/wp-typography/vendor-scoped/level-2/dice/Dice.php on line 184
    
    Deprecated: Method ReflectionParameter::getClass() is deprecated in /home/username/public_html/wp-content/plugins/wp-typography/vendor-scoped/level-2/dice/Dice.php on line 184
    
    Deprecated: Method ReflectionParameter::getClass() is deprecated in /home/username/public_html/wp-content/plugins/wp-typography/vendor-scoped/level-2/dice/Dice.php on line 184
    
    Deprecated: Method ReflectionParameter::getClass() is deprecated in /home/username/public_html/wp-content/plugins/wp-typography/vendor-scoped/level-2/dice/Dice.php on line 184
    
    Deprecated: Method ReflectionParameter::getClass() is deprecated in /home/username/public_html/wp-content/plugins/wp-typography/vendor-scoped/level-2/dice/Dice.php on line 184
    
    Deprecated: Method ReflectionParameter::getClass() is deprecated in /home/username/public_html/wp-content/plugins/wp-typography/vendor-scoped/level-2/dice/Dice.php on line 184
    
    Deprecated: Method ReflectionParameter::getClass() is deprecated in /home/username/public_html/wp-content/plugins/wp-typography/vendor-scoped/level-2/dice/Dice.php on line 184
    
    Deprecated: Method ReflectionParameter::getClass() is deprecated in /home/username/public_html/wp-content/plugins/wp-typography/vendor-scoped/level-2/dice/Dice.php on line 184
    
    Deprecated: Method ReflectionParameter::getClass() is deprecated in /home/username/public_html/wp-content/plugins/wp-typography/vendor-scoped/level-2/dice/Dice.php on line 184
    
    Deprecated: Method ReflectionParameter::getClass() is deprecated in /home/username/public_html/wp-content/plugins/wp-typography/vendor-scoped/level-2/dice/Dice.php on line 184
    
    Deprecated: Method ReflectionParameter::getClass() is deprecated in /home/username/public_html/wp-content/plugins/wp-typography/vendor-scoped/level-2/dice/Dice.php on line 184
    
    Deprecated: Method ReflectionParameter::getClass() is deprecated in /home/username/public_html/wp-content/plugins/wp-typography/vendor-scoped/level-2/dice/Dice.php on line 184
    
    Deprecated: Method ReflectionParameter::getClass() is deprecated in /home/username/public_html/wp-content/plugins/wp-typography/vendor-scoped/level-2/dice/Dice.php on line 184
    
    Deprecated: Method ReflectionParameter::getClass() is deprecated in /home/username/public_html/wp-content/plugins/wp-typography/vendor-scoped/level-2/dice/Dice.php on line 184
    
    Deprecated: Method ReflectionParameter::getClass() is deprecated in /home/username/public_html/wp-content/plugins/wp-typography/vendor-scoped/level-2/dice/Dice.php on line 184
    
    Deprecated: Method ReflectionParameter::getClass() is deprecated in /home/username/public_html/wp-content/plugins/wp-typography/vendor-scoped/level-2/dice/Dice.php on line 184
    
    Deprecated: Method ReflectionParameter::getClass() is deprecated in /home/username/public_html/wp-content/plugins/wp-typography/vendor-scoped/level-2/dice/Dice.php on line 184
    
    Deprecated: Method ReflectionParameter::getClass() is deprecated in /home/username/public_html/wp-content/plugins/wp-typography/vendor-scoped/level-2/dice/Dice.php on line 184
    
    Deprecated: Method ReflectionParameter::getClass() is deprecated in /home/username/public_html/wp-content/plugins/wp-typography/vendor-scoped/level-2/dice/Dice.php on line 184
    
    Deprecated: Method ReflectionParameter::getClass() is deprecated in /home/username/public_html/wp-content/plugins/wp-typography/vendor-scoped/level-2/dice/Dice.php on line 184
    
    Deprecated: Method ReflectionParameter::getClass() is deprecated in /home/username/public_html/wp-content/plugins/wp-typography/vendor-scoped/level-2/dice/Dice.php on line 184
    
    Deprecated: Method ReflectionParameter::getClass() is deprecated in /home/username/public_html/wp-content/plugins/wp-typography/vendor-scoped/level-2/dice/Dice.php on line 184
    
    Deprecated: Method ReflectionParameter::getClass() is deprecated in /home/username/public_html/wp-content/plugins/wp-typography/vendor-scoped/level-2/dice/Dice.php on line 184
    
    Deprecated: Method ReflectionParameter::getClass() is deprecated in /home/username/public_html/wp-content/plugins/wp-typography/vendor-scoped/level-2/dice/Dice.php on line 184
    
    Deprecated: Method ReflectionParameter::getClass() is deprecated in /home/username/public_html/wp-content/plugins/wp-typography/vendor-scoped/level-2/dice/Dice.php on line 184
    
    Deprecated: Method ReflectionParameter::getClass() is deprecated in /home/username/public_html/wp-content/plugins/wp-typography/vendor-scoped/level-2/dice/Dice.php on line 184
    
    Deprecated: Method ReflectionParameter::getClass() is deprecated in /home/username/public_html/wp-content/plugins/wp-typography/vendor-scoped/level-2/dice/Dice.php on line 184
    
    Deprecated: Method ReflectionParameter::getClass() is deprecated in /home/username/public_html/wp-content/plugins/wp-typography/vendor-scoped/level-2/dice/Dice.php on line 184
    
    Deprecated: Method ReflectionParameter::getClass() is deprecated in /home/username/public_html/wp-content/plugins/wp-typography/vendor-scoped/level-2/dice/Dice.php on line 184
    
    Deprecated: Method ReflectionParameter::getClass() is deprecated in /home/username/public_html/wp-content/plugins/wp-typography/vendor-scoped/level-2/dice/Dice.php on line 184
    
    Deprecated: Required parameter $action follows optional parameter $format in /home/username/public_html/wp-content/plugins/wp-ulike/includes/hooks/third-party.php on line 334
    
    Deprecated: Required parameter $component follows optional parameter $format in /home/username/public_html/wp-content/plugins/wp-ulike/includes/hooks/third-party.php on line 334
    
    Deprecated: Required parameter $id follows optional parameter $format in /home/username/public_html/wp-content/plugins/wp-ulike/includes/hooks/third-party.php on line 334
    
    Deprecated: Required parameter $networks follows optional parameter $share in /home/username/public_html/wp-content/plugins/easy-social-share-buttons3/lib/core/share-counters/essb-cached-counters.php on line 161
    
    Deprecated: Required parameter $key follows optional parameter $field in /home/username/public_html/wp-content/plugins/woocommerce-checkout-field-editor/includes/wc-checkout-field-functions.php on line 360
    
    Deprecated: Required parameter $args follows optional parameter $field in /home/username/public_html/wp-content/plugins/woocommerce-checkout-field-editor/includes/wc-checkout-field-functions.php on line 360
    
    Deprecated: Required parameter $value follows optional parameter $field in /home/username/public_html/wp-content/plugins/woocommerce-checkout-field-editor/includes/wc-checkout-field-functions.php on line 360
    
    Deprecated: Required parameter $key follows optional parameter $field in /home/username/public_html/wp-content/plugins/woocommerce-checkout-field-editor/includes/wc-checkout-field-functions.php on line 403
    
    Deprecated: Required parameter $args follows optional parameter $field in /home/username/public_html/wp-content/plugins/woocommerce-checkout-field-editor/includes/wc-checkout-field-functions.php on line 403
    
    Deprecated: Required parameter $value follows optional parameter $field in /home/username/public_html/wp-content/plugins/woocommerce-checkout-field-editor/includes/wc-checkout-field-functions.php on line 403
    
    Deprecated: Required parameter $key follows optional parameter $field in /home/username/public_html/wp-content/plugins/woocommerce-checkout-field-editor/includes/wc-checkout-field-functions.php on line 443
    
    Deprecated: Required parameter $args follows optional parameter $field in /home/username/public_html/wp-content/plugins/woocommerce-checkout-field-editor/includes/wc-checkout-field-functions.php on line 443
    
    Deprecated: Required parameter $value follows optional parameter $field in /home/username/public_html/wp-content/plugins/woocommerce-checkout-field-editor/includes/wc-checkout-field-functions.php on line 443
    
    Deprecated: Required parameter $key follows optional parameter $field in /home/username/public_html/wp-content/plugins/woocommerce-checkout-field-editor/includes/wc-checkout-field-functions.php on line 492
    
    Deprecated: Required parameter $args follows optional parameter $field in /home/username/public_html/wp-content/plugins/woocommerce-checkout-field-editor/includes/wc-checkout-field-functions.php on line 492
    
    Deprecated: Required parameter $value follows optional parameter $field in /home/username/public_html/wp-content/plugins/woocommerce-checkout-field-editor/includes/wc-checkout-field-functions.php on line 492
    
    Deprecated: Required parameter $ad follows optional parameter $options in /home/username/public_html/wp-content/plugins/advanced-ads-pro/modules/advanced-display-conditions/main.class.php on line 137
    
    Deprecated: Required parameter $ad follows optional parameter $options in /home/username/public_html/wp-content/plugins/advanced-ads-pro/modules/advanced-display-conditions/main.class.php on line 167
    
    Deprecated: Required parameter $ad follows optional parameter $options in /home/username/public_html/wp-content/plugins/advanced-ads-pro/modules/advanced-display-conditions/main.class.php on line 198
    
    Deprecated: Required parameter $ad follows optional parameter $options in /home/username/public_html/wp-content/plugins/advanced-ads-pro/modules/advanced-display-conditions/main.class.php on line 225
    
    Deprecated: Required parameter $ad follows optional parameter $options in /home/username/public_html/wp-content/plugins/advanced-ads-pro/modules/advanced-display-conditions/main.class.php on line 253
    
    Deprecated: Required parameter $ad follows optional parameter $options in /home/username/public_html/wp-content/plugins/advanced-ads-pro/modules/advanced-display-conditions/main.class.php on line 291
    
    Deprecated: Required parameter $ad follows optional parameter $content in /home/username/public_html/wp-content/plugins/advanced-ads-pro/modules/advanced-visitor-conditions/main.class.php on line 733
    
    Deprecated: Required parameter $ad follows optional parameter $options in /home/username/public_html/wp-content/plugins/advanced-ads-pro/modules/click-fraud-protection/click-fraud-protection.class.php on line 293
    
    Deprecated: Required parameter $group follows optional parameter $options in /home/username/public_html/wp-content/plugins/advanced-ads-pro/modules/click-fraud-protection/click-fraud-protection.class.php on line 306
    
    Deprecated: Required parameter $group follows optional parameter $ad_count in /home/username/public_html/wp-content/plugins/advanced-ads-pro/modules/grids/grids.class.php on line 70
    
    Deprecated: Required parameter $group follows optional parameter $ad_count in /home/username/public_html/wp-content/plugins/advanced-ads-pro/modules/group-refresh/group-refresh.class.php on line 324
    
    Deprecated: Required parameter $ad follows optional parameter $content in /home/username/public_html/wp-content/plugins/advanced-ads-pro/modules/inject-content/inject-content.class.php on line 234
    
    Deprecated: Required parameter $placement_id follows optional parameter $content in /home/username/public_html/wp-content/plugins/advanced-ads-pro/modules/inject-content/inject-content.class.php on line 446
    
    Deprecated: Required parameter $placement_id follows optional parameter $content in /home/username/public_html/wp-content/plugins/advanced-ads-pro/modules/inject-content/inject-content.class.php on line 656
    
    Deprecated: Required parameter $ad follows optional parameter $options in /home/username/public_html/wp-content/plugins/advanced-ads-pro/modules/paid-memberships-pro/main.class.php on line 48
    
    Deprecated: Required parameter $ad follows optional parameter $options in /home/username/public_html/wp-content/plugins/advanced-ads-pro/modules/paid-memberships-pro/main.class.php on line 164
    
    Deprecated: Required parameter $ad follows optional parameter $options in /home/username/public_html/wp-content/plugins/advanced-ads-pro/modules/weekdays/weekdays.class.php on line 64
    
    Deprecated: Required parameter $font_family follows optional parameter $id in /home/username/public_html/wp-content/plugins/ts-visual-composer-extend/registrations/ts_vcsc_registrations_functions.php on line 551
    
    Deprecated: Required parameter $font_type follows optional parameter $id in /home/username/public_html/wp-content/plugins/ts-visual-composer-extend/registrations/ts_vcsc_registrations_functions.php on line 551
    
    Deprecated: Required parameter $color_background follows optional parameter $output in /home/username/public_html/wp-content/plugins/ts-visual-composer-extend/registrations/ts_vcsc_registrations_functions.php on line 640
    
    Deprecated: Required parameter $color_shadow follows optional parameter $output in /home/username/public_html/wp-content/plugins/ts-visual-composer-extend/registrations/ts_vcsc_registrations_functions.php on line 640
    
    Deprecated: Required parameter $color_other follows optional parameter $output in /home/username/public_html/wp-content/plugins/ts-visual-composer-extend/registrations/ts_vcsc_registrations_functions.php on line 640
    
    Deprecated: Required parameter $period follows optional parameter $scope in /home/username/public_html/wp-content/plugins/ts-visual-composer-extend/classes/ts_vcsc_class_timesensitive.php on line 79
    
    Deprecated: Required parameter $current follows optional parameter $scope in /home/username/public_html/wp-content/plugins/ts-visual-composer-extend/classes/ts_vcsc_class_timesensitive.php on line 79
    • This reply was modified 3 years, 1 month ago by berry metal.
    Thread Starter berry metal

    (@erikalleman)

    I removed the conditional, this is my current code:

    add_action( 'wp_enqueue_scripts', function() {
        
            wp_enqueue_style( 'ad_stats_styles', '/ads_stats.css', array() );
        
    }, PHP_INT_MAX );

    Is passing the empty array correct in the code?
    “file reference appears correctly somewhere on the page”
    do you mean file reference in the HTML?
    could you show a screenshot about what you mean?

    I only have to look in the HTML head, to find the handle of my style listed, is that right?

    this is the original CSS file of the ad stats page:

    https://mysite.com/wp-content/plugins/advanced-ads-tracking/public/assets/css/public-stats.css

    Moderator bcworkz

    (@bcworkz)

    Yes, deprecated warnings seem to be unrelated.

    Yes, an empty array is fine for a dependencies arg. The resulting link should be in the head section. Scripts might instead be in the footer. Normally, all enqueued styles are in the head section. All the same, search the entire HTML for the filename (Ctrl/Cmd-F). The file reference should look like this:
    <link rel='stylesheet' id='ad_stats_styles' href='https://example.com/wp-content/plugins/my-plugin/ads_stats.css?ver=5.9' media='all' />

    If the reference appears, ensure the path is correct. You need to provide a full URL to the file. Relative references do not work well in WP.
    plugin_dir_url( __FILE__ ).'ads_stats.css'
    for stylesheests kept in a plugin. If your stylesheets are kept in a child theme, use get_stylesheet_directory_uri() instead.

    If the reference appears correctly, then you can focus on targeting the one page and positioning the reference relative to others. Test modifications frequently so any errors are easier to locate.

    Thread Starter berry metal

    (@erikalleman)

    Hi there,

    yes the php file (the plugin) is in the correct mu-plugins directory.

    This is my current plugin code including 2 var dumps that I inserted for testing, so this is my plugin file in the mu-plugins directory:

    var_dump( 'test' );
    add_action( 'wp_enqueue_scripts', function() {
        if ( false !== strpos(  var_dump($_SERVER['REQUEST_URI']), 'ad-stats' ) ) {
            wp_enqueue_style( 'ad_stats_styles', get_stylesheet_directory_uri() . '/ads_stats.css', array() );
        }
    }, PHP_INT_MAX );

    After adding the first var dump at the top of the plugin, the “test” string is flashed for a second on the top of the page, so that works.

    But after adding the additional var dump to $_SERVER[‘REQUEST_URI’], no new “test” string is shown other than the one at the top that was added previously.

    There is no ads_stats.css present in the HTML, so the file is not enqueued.

    I reduced the priority if my child theme enqueuing script to 999, so only my /ads_stats.css is PHP_INT_MAX:

    function my_load_child_theme_styles() {
    
        if ( ! defined( 'WPEX_THEME_STYLE_HANDLE' ) ) {
            wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css', array(), '1.0' );
        }
    
        // First de-register the main stylesheet (which is now your child theme style.css)
        wp_dequeue_style( WPEX_THEME_STYLE_HANDLE );
        wp_deregister_style( WPEX_THEME_STYLE_HANDLE );
    
        // Add the parent style.css with the main style handle
        wp_enqueue_style( WPEX_THEME_STYLE_HANDLE, get_template_directory_uri() . '/style.css', array(), WPEX_THEME_VERSION );
    
        // Re-add child CSS with parent as dependency
        wp_enqueue_style( 'child-css', get_stylesheet_directory_uri() . '/style.css', array( WPEX_THEME_STYLE_HANDLE ), '1.0' );
    
        wp_enqueue_style(
        'child_media-css', // stylesheet handle
        get_stylesheet_directory_uri() . '/child_media_600_max.css', // stylesheet file URL
        array( WPEX_THEME_STYLE_HANDLE ), // dependencies
        '1.0', // stylesheet version
        'only screen and (max-width:600px)' // media query
    );
    
    
    wp_enqueue_style(
        'child_media-css', // stylesheet handle
        get_stylesheet_directory_uri() . '/child_media_600_min.css', // stylesheet file URL
        array( WPEX_THEME_STYLE_HANDLE ), // dependencies
        '1.0', // stylesheet version
        'only screen and (min-width:600px)' // media query
    );
    
    }
    add_action( 'wp_enqueue_scripts', 'my_load_child_theme_styles', 999 );

    But /ads_stats.css is still not getting enqueued.

    When loading the ad stats page I tried to filter for DOC requestst in the Network tab, and there is only one request, this one:

    flameshot_screenshot

    What I could not determine, if this is requested from my WP install directory or not.
    Could you advise how to determine that?

    I have also tried to remove the URI conditional, but it doesn’t change anything.
    I have also tried to use absolute path to ads_stats.css, and remove the get_stylesheet_directory_uri() part, but it doesn’t change anything.
    ads_stats.css is in my child theme directory.

    Why is the empty array necessary in the code?

    Thanks!
    Best regards.

    Thread Starter berry metal

    (@erikalleman)

    If none of the absolute and relative paths work:
    /ads_stats.css
    mysite.com/wp-content/themes/total-child-theme-master/ads_stats.css

    what could be the issue?

    Moderator bcworkz

    (@bcworkz)

    The doc request in the network tab is to /ad-stats/ in the public root folder. If that folder does not physically exist there, then the request is in the WP context. Also as evidenced by your plugin briefly outputting “test”. Your example URL mysite.com/wp-content/themes/ indicates your WP installation is in the site’s public root. A subfolder installation would have an URL like mysite.com/wordpress/wp-content/themes/.

    Your conditional for $_SERVER[‘REQUEST_URI’] will not work with var_dump() in there because it doesn’t return the right value. It simply generates output. Call var_dump() on its own line if you want to examine a variable’s value.

    It may be the ad stats page does not utilize the normal WP enqueuing scheme. As a test, in the $_SERVER[‘REQUEST_URI’] conditional, change ‘ad-stats’ to the slug of a normal WP post or page you have (and remove the var_dump). Request that page and look in its HTML source for the enqueued file reference. I predict it will appear, indicating that you’ve enqueued correctly, but that the ad-stats page doesn’t use the WP enqueue scheme.

    If the WP enqueue scheme is not used on the ad-stats page, you’ll need to examine the ad-stats code responsible for head section output and see if any hooks are available. If there are not, you may be better off outputting a <style> block with the desired CSS. This can even be output in the <body> section if need be. You’d still want to find a hook to use, but you have more options since a style block can appear almost anywhere.

    If there are simply no available hooks for the page, it would still be possible to buffer the output and alter it while it’s in the buffer. You’d need to determine how the output code is initially called when the HTTPS request comes in.

    Thread Starter berry metal

    (@erikalleman)

    Hi,

    yes, if I use a post slug in the REQUEST_URI conditional, the style will be enqueued for the post, so the enqueuing is correct.

    Its link has media=’all’. What does that mean?
    So the ad stats page does not utilize the normal WP enqueuing scheme.

    There is no ad-stats folder on my server or in my public root folder, only ad-stats.php file (not in the public root folder but in the plugin folders) that means that the the doc request is in WP context, it seems.

    I found the plugin code that outputs the ad_stats page head:

    <?php
    // phpcs:disable WordPress.WP.EnqueuedResources.NonEnqueuedScript
    
    if ( ! defined( 'WPINC' ) ) {
    	die;
    }
    if ( ! isset( $ad_id ) ) {
    	die;
    }
    $period     = ( isset( $_GET['period'] ) && ! empty( $_GET['period'] ) ) ? stripslashes( $_GET['period'] ) : 'last30days';
    $ad         = new Advanced_Ads_Ad( $ad_id );
    $ad_options = $ad->options();
    $ad_name    = ( isset( $ad_options['tracking']['public-name'] ) && ! empty( $ad_options['tracking']['public-name'] ) ) ? $ad_options['tracking']['public-name'] : $ad->title;
    ?>
    <!DOCTYPE html>
    <html <?php language_attributes(); ?>>
    <head>
    	<meta charset="<?php echo get_option( 'blog_charset' ); ?>">
    	<title><?php echo esc_url( get_bloginfo( 'name' ) ); ?>|<?php esc_html_e( 'Ad Statistics', 'advanced-ads-tracking' ); ?></title>
    	<meta name="robots" content="noindex, nofollow"/>
    	<script type="text/javascript">
    		var AAT_SPINNER_URL = '<?php echo esc_url( AAT_BASE_URL . 'public/assets/images/spinner-2x.gif' ); ?>';
    	</script>
    	<script type="text/javascript" src="<?php echo includes_url( '/js/jquery/jquery.js' ); ?>"></script>
    	<script type="text/javascript" src="<?php echo includes_url( '/js/jquery/jquery-migrate.min.js' ); ?>"></script>
    	<script type="text/javascript"
    			src="<?php echo AAT_BASE_URL . 'admin/assets/jqplot/jquery.jqplot.min.js'; ?>"></script>
    	<script type="text/javascript"
    			src="<?php echo AAT_BASE_URL . 'admin/assets/jqplot/plugins/jqplot.dateAxisRenderer.min.js'; ?>"></script>
    	<script type="text/javascript"
    			src="<?php echo AAT_BASE_URL . 'admin/assets/jqplot/plugins/jqplot.highlighter.min.js'; ?>"></script>
    	<script type="text/javascript"
    			src="<?php echo AAT_BASE_URL . 'admin/assets/jqplot/plugins/jqplot.cursor.min.js'; ?>"></script>
    	<?php
    	printf(
    		'<script src="%s"></script>',
    		esc_url( AAT_BASE_URL . 'public/assets/js' . ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '/src/public-stats.js' : '/dist/public-stats.min.js' ) )
    	);
    	?>
    	<link rel="stylesheet" href="<?php echo AAT_BASE_URL . 'admin/assets/jqplot/jquery.jqplot.min.css'; ?>"/>
    	<link rel="stylesheet" href="<?php echo AAT_BASE_URL . 'public/assets/css/public-stats.css'; ?>"/>
    	<?php do_action( 'advanced-ads-public-stats-head' ); ?>
    </head>

    At the top it states something about disabling enqueuing.

    There is an action hook at the end!

    do_action( 'advanced-ads-public-stats-head' );

    Is it possible to use this hook to enqueue my styles?

    If there are not, you may be better off outputting a <style> block with the desired CSS.

    Do you mean to inject inline styles? Do I still need to inject inline styles if I have the hook above, and use the hook for that purpose, or I can enqueue the styles using that hook?

    Best regards.

    Thread Starter berry metal

    (@erikalleman)

    This hook is not listed at the hooks in the plugin docs, hence I didn’t know about it.

Viewing 15 replies - 1 through 15 (of 25 total)
  • The topic ‘How do I style dynamically generated pages?’ is closed to new replies.