WordPress.org

Support

Support » Plugins and Hacks » [Resolved] Background image on age verify

[Resolved] Background image on age verify

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author Chase Wiseman

    @chasewiseman

    Try utilizing one of the plugin’s actions to add custom css code. Something like this:

    <?php add_action( 'av_custom_styles', 'my_av_custom_styles' );
    
    function my_av_custom_styles() { ?>
    
        <style type="text/css">
            #av-overlay-wrap {
                background: url(path/to/your/image.png);
            }
        </script>
    
    <?php } ?>

    First thank you very much for answering.
    Do i have to add that function to function.php? Create a new file with that code? I did not understand what you mean by adding custom css code to the plugin’s actions.

    Plugin Author Chase Wiseman

    @chasewiseman

    Try pasting the above code into your themes functions.php file.

    I am using Mantra theme. When I paste that code to theme-function.php , The age verify box it is show almost properly(forces you to chose fast on the dropdowns or the dropdowns close automaticaly). But the main problem is that forces a conflict with the main div where the information is, removes the proper configuration, align,width and height, etc. Is there any simple solution (changing some code is not a problem) or is better to use color as background and forget about image?
    Thank you very much for your time.

    Plugin Author Chase Wiseman

    @chasewiseman

    I am unfamiliar with the Mantra theme, so I can’t help much when it comes to that theme’s styling. I would suggest asking whoever made the theme for some direction as to where to place that code.

    Thank you for your help

    michent1

    @michent1

    Hi, we tried adding the code you noted above to our theme functions.php file to create an action and it totally broke our theme. Even after uninstalling the Age Verify plugin, we’re still geting the “Are you 21 years old to visit this site” info in the footer and the responsive design is no longer working. Could you tell me which specific files that code would affect so we can fix this? Thanks!
    Awesome plugin by the way!

    Hi. I was able to add a background image. In the settings.php file for the plug-in, once I removed the following lines, I was able to see the changes I made to #av-overlay-wrap

    remove:

    <?php }
    
    /**
     * Prints the background color settings field.
     *
     * @since 0.1
     */
    function av_settings_callback_bgcolor_field() { ?>
    
    	<fieldset>
    
    		<legend class="screen-reader-text">
    			<span><?php esc_html_e( 'Background Color' ); ?></span>
    		</legend>
    
    		<?php $default_color = '';
    
    		if ( current_theme_supports( 'custom-background', 'default-color' ) )
    			$default_color = ' data-default-color="#' . esc_attr( get_theme_support( 'custom-background', 'default-color' ) ) . '"'; ?>
    
    		<input type="text" name="_av_bgcolor" id="_av_bgcolor" value="#<?php echo esc_attr( av_get_background_color() ); ?>"<?php echo $default_color ?> />
    
    	</fieldset>
    
    <?php }

    Once the website goes live, I’ll post the URL

    If i remove the code mentioned above in the plugin setting.php, do i then just modify the #av-overlay-wrap with css code in the Theme options?

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘[Resolved] Background image on age verify’ is closed to new replies.