Embed Javascript code to registered users only

WordPress provides the Conditional Tags. I think is_user_logged_in() tag will work for you. List of conditional tags available. if ( is_user_logged_in() ) { // include the JavaScript File } UPDATE: Also if you want to check the user roles etc.. you can use the current_user_can() you can check both the both roles and capabilities. Better … Read more

Add Alt attribute to image served with php

just add it in… <div class=”bd-layoutcolumn-20 bd-column” ><div class=”bd-vertical-align-wrapper”> <img alt =”my alt tag” class=”bd-imagelink-3 bd-imagestyles ” src=”https://wordpress.stackexchange.com/questions/244847/<?php echo theme_get_image_path (“images/b56392d722ada5890c6d2f29f1dbde4a_logo.jpg’); ?>”> if you’re going to make it dynamic you’ll need to add the php. Something like this if you’re in a loop: <div class=”bd-layoutcolumn-20 bd-column” ><div class=”bd-vertical-align-wrapper”> <img alt =”<?php echo get_the_title();?>” class=”bd-imagelink-3 bd-imagestyles … Read more

How to hide the Duplicate taxonomy values in WordPress?

I did not test the code. But this should be work. <div id=”footer”> <h1>Area Names </h1> <?php $taxonomyArray = array(“health_area”,”schools_area”,”office_area”,”salonsandsaps_area”); $temp_array=array(); for($Inc=0;$Inc<count($taxonomyArray);$Inc++){ $orderby = ‘name’; $show_count = 0; // 1 for yes, 0 for no $pad_counts = 0; // 1 for yes, 0 for no $hierarchical = 1; // 1 for yes, 0 for no … Read more