Button generate a random URL [closed]

It looks like your code works as written. Alternatively, you can generate an alphanumeric string using uniqid()… <a href=”http://meet.jit.si/<?php echo uniqid()?>” target=”_blank”> click here </a> EDIT: Modified code based on additional information. This should create a shortcode that allows you to easily add a button to a unique meeting link by adding [rand_jitsi_btn] to a … Read more

Simple WordPress function / plugin to redirect a site

While the plugin might solve your problem you could try something direct with WordPress API: add_action( ‘template_redirect’, ‘wpse_142191_all_redirect’ ); function wpse_142191_all_redirect() { if ( !is_user_logged_in() ) { wp_redirect( ‘http://other-site.com’, 301); exit; //always die or exit after redirect } } Be careful with it,this will redirect the whole site on the home page of other site. … Read more

Hiding Google Analytics code based on theme options

Take the GA code from your header and wrap it in a function hooked to wp_head; function __analytics_head() { $options = get_option( ‘themename_theme_options’ ); if ( !empty( $options[‘analytics’] ) ) : ?> <script type=”text/javascript”> var _gaq = _gaq || []; _gaq.push([‘_setAccount’, ‘<?php echo esc_js( $options[‘analytics’] ) ; ?>’]); _gaq.push([‘_trackPageview’]); (function() { var ga = document.createElement(‘script’); … Read more