Bring Font Awesome icons inside menu A tags

What I have tried in the past is to place the Font-awesome code with class name in the label field and remove any current labels. Instead of using the optional class field, this worked for me in the past. I have not tried it lately, so I am not sure if this still works. For … Read more

How to make a vote in the poll for registered users?

You can check user logged in with is_user_logged_in. This is a simple function to check user logged in or not. Can you try this? <ol class=”zf-structure-list zf-quiz_answer zf-text zf-clearfix”> <?php if(is_user_logged_in()){ if( isset( $question[“answers”] ) ) { foreach ($question[“answers”] as $answer) { ?> <li class=”zf-answer-item <?php if (isset($_COOKIE[“zf_poll_vote_ans_” . $answer[“answer_id”]])) echo ‘zf-selected’; ?>” data-voted=”<?php echo … Read more

setcookie() issues on running with HTTPS on WordPress

Both examples should work fine if your WordPress site is running on https://. However, I would recommend you set up the cookies by using available constants and functions provided by WordPress, it makes things more organized. See example below: setcookie( ‘lat’, sanitize_text_field( $_POST[‘lat’] ), strtotime( ‘+14 days’ ), “https://wordpress.stackexchange.com/”, esc_COOKIE_DOMAIN, is_ssl(), true ); Notice that … Read more

When to use wp_register_script() function?

I have gone through some articles and come to the following conclusion. I think it helps. Registering any scripts using wp_register_script() is just registering; not loading it. The registered script will not be loaded until it is enqueued using wp_enqueue_script(). We don’t need to register and enqueue each of the scripts simultaneously. We should just … Read more