jQuery toggling without using toggle

//set initial status
$('element').data('status','not_clicked');

$('element').click(function(){
    if( $(this).data('status') == 'clicked' ) {
        $(this).data('status','not_clicked');

        //your code in case of second click
    } else {
        $(this).data('status','clicked');

        //your code in case of first click
    }
});

jQuery toggling without using toggle

What it does:

Sets the initial status – not_clicked

In case of a click:

  • If the current status is clicked sets it to not_clicked (reset) and runs scripts
  • else – changes status to clicked and runs scripts.

Checkout some common problems.

Get Unique Post Meta Values From a Meta Key
How to make a custom widget area in wordpress?
How to Add Page Slug in Body Class of your WordPress Theme ?
How to make scroll to top ?
Media upload default linking (change the attachment link to none in WordPress)