Wednesday, May 28, 2025
HomeHealthy FoodHow to Cook Frozen Shrimp & 20 Recipes!

How to Cook Frozen Shrimp & 20 Recipes!


Learn how to cook frozen shrimp on the stovetop in 10 minutes! You’ll get perfectly juicy, seasoned shrimp ready to serve as an appetizer or entree.

How to cook frozen shrimp, frozen shrimp recipes

Staring at that bag of frozen shrimp and don’t know what to do with it? Well, you’re in the right place! I’m sharing my fool-proof method for cooking frozen shrimp on the stove. (And how to thaw it beforehand!) 

Shrimp is a fantastic protein because it’s healthy, quick to cook, and stores well in the freezer. It’s also incredibly versatile. I can turn my frozen shrimp into a quick appetizer, toss it into pasta, or even use it to build a flavorful rice bowl. 

With my simple tips and cooking method, you’ll have juicy, tender, sautéed shrimp on the table in no time.

Thaw the Shrimp First 

It’s best to thaw the shrimp before cooking it to avoid rubbery, overcooked shrimp. Rubbery shrimp happens when you cook fish from frozen, and the outer layer starts cooking before the inside has fully thawed. As a result, the outside can become overcooked by the time the inside is done. 

The best way to thaw frozen raw shrimp is to place them in the refrigerator for 12 hours to allow them to defrost. If you don’t have those extra hours on hand, though, don’t worry! Here’s my quick method for defrosting shrimp:

  1. Place the shrimp in a large bowl of cold water.
  2. Set a timer for 15 minutes and stir the bowl every 5 minutes to break up clumps that freeze together. The shrimp should be defrosted in about 15 to 20 minutes, depending on the size of the shrimp (larger shrimp can take up to 20 minutes).
  3. Pat the thawed shrimp dry. This is important; otherwise, the shrimp will steam instead of cooking (unless you plan to boil or steam them).

What Ingredients Are Needed

While I love making a variety of shrimp dishes and cooking shrimp in different ways (as I’ll discuss later on), sometimes it’s best to go back to the basics. For my classic frozen shrimp recipe, I use the following main ingredients: 

  • Frozen shrimp (thawed): I use medium, frozen, deveined shrimp (which means the main central vein is removed). You can use either tail-on or peeled shrimp!
  • Smoked paprika: I personally love using smoked paprika for this shrimp recipe. It gives the shrimp an extra layer of flavor and adds some spice to the dish. If I don’t have smoked paprika on hand, I can always opt for standard paprika instead. 
  • My classic seasoning mixture: I combine garlic powder, onion powder, cumin, and kosher salt to create a savory, earthy flavor profile. 
  • Butter: Butter adds richness when cooking shrimp. You can also substitute the butter with olive oil, if desired, for dietary needs or flavor preference. 

See the list of full ingredients with exact amounts in the recipe card below. 

Time to Get Cooking 

Once the shrimp are thawed and you’ve gathered all the ingredients, it’s time to start sautéing them on the stovetop. Here’s a step-by-step walkthrough of how to perfectly cook frozen shrimp:

  1. Place the shrimp in a large bowl of very cold water for 15 minutes, stirring every 5 minutes to break up clumps that freeze together. (After 15 minutes, rinse off any remaining ice.)
  2. Pat the shrimp completely dry. In a medium bowl, mix the shrimp with the salt, smoked paprika, garlic powder, onion powder, and cumin.
  3. In a large skillet, heat the butter on medium-high heat. Add the shrimp and cook for 1-2 minutes per side until just opaque and cooked through.
  4. Spritz with lemon juice from the wedges and serve immediately. 

Dietary Notes

This frozen shrimp recipe is pescatarian and dairy-free with olive oil. 

⭐⭐⭐⭐⭐

“This was the best shrimp recipe! So easy, quick & delicious!”

– Valorie

20 More Ways to Cook Frozen Shrimp

While my basic cooking recipe is great, I like to change things up and get creative with shrimp recipes in my kitchen. Here are all my favorite cooking methods and ways to prepare shrimp to make a delicious, healthy, seafood-inspired entree or appetizer.

1. Sautéed Shrimp

Here’s an easy recipe that knocked me off my feet — and it takes just 3 minutes to cook! I share my best tips and tricks for getting perfectly sautéed and seasoned shrimp every time.

Get Recipe

2. Steamed Shrimp

Here’s a fun way to cook shrimp without all the hassle of a full-on shrimp boil: Old Bay Steamed Shrimp! This cooking method combines boiling and steaming, resulting in succulent, seasoned shrimp. (Bonus: The cook time is only 2-3 minutes!)  

Get Recipe

3. Easy Baked Shrimp

This oven-baked shrimp is simple, juicy, and beautifully seasoned with garlic and herbs. It’s a fantastic, healthy, and quick dinner option.

Get Recipe

4. Broiled Shrimp

Broiled shrimp is exceptionally delicious, and you don’t even need to preheat the oven! It’s seasoned with garlic and lemon and is perfectly tender. Want some extra texture? Add breading for an irresistible crunch!

Get Recipe

5. Boiled Shrimp

The most popular way to use boiled shrimp is for shrimp cocktail, but you can boil it for any type of preparation. The advantage of boiling? It keeps well at room temperature, making it perfect to sit out on a platter while entertaining family and friends.

Get Recipe

6. Blackened Shrimp

Blackening is a Cajun cooking technique that’s all about the spices. Combine homemade blackened seasoning with grilled or pan-fried shrimp, and you’ve got an irresistible mix of savory, herbal, and salty flavored shrimp!

Get Recipe

7. Easy Cajun Shrimp

This easy Cajun shrimp recipe takes just 5 minutes and is packed with savory and garlicky flavors. Pair it with a quick veggie side dish or salad, and you’ve got dinner!

Get Recipe

8. Honey Garlic Shrimp

There’s nothing like the sweet, savory combination of honey garlic glaze and juicy shrimp. The best part? It takes 10 minutes to make and has lightning-fast prep time. This is one of my favorite easy dinner ideas in over a decade of creating recipes!

Get Recipe

9. Easy Pesto Shrimp

This pesto shrimp is a dinnertime win! Savory basil pesto is a natural pairing with juicy shrimp; serve with pasta or rice for an easy dinner idea. This bright green, garlicky sauce is the perfect pairing for this succulent shellfish! 

Get Recipe

10. Shrimp Scampi

The Italian American shrimp scampi: a classic that’s been stealing hearts and minds for decades. Sauté shrimp and toss with a luxurious lemony garlic butter sauce. Sop it up with bread, or pour it over pasta – either way, it’s divine!

Get Recipe

11. Quick Shrimp Tacos

These easy shrimp tacos are a fast dinner recipe for weeknights or entertaining. They taste stunning drizzled in a creamy cilantro sauce! 

Get Recipe 

12. Shrimp Fra Diavolo

This Italian-style dish features tender shrimp swimming in a garlicky, spicy tomato sauce. Typically, this dish has intense heat. Make it homemade, though, and you can customize the spiciness to taste!

Get Recipe

13. Shrimp Fajitas

Every time I serve this Tex-Mex favorite, it gets rave reviews from everyone around the table. The fajita veggies are seasoned to perfection, and the shrimp are juicy and buttery. 

Get Recipe

14. Cilantro Lime Shrimp

This vibrant cilantro lime shrimp is ready in just 10 minutes! Juicy shrimp coated in zesty lime and fresh cilantro makes a quick, flavorful protein perfect for tacos, rice bowls, or a simple family dinner.

Get Recipe

15. Easy BBQ Shrimp

This BBQ shrimp recipe is quick and easy, with big, bold flavors. It’s the perfect fast dinner served with a side of rice, bread, or a salad.

Get Recipe

16. Sheet Pan Shrimp and Veggies

This sheet pan shrimp dinner has become a reader favorite for its big flavors and easy prep! Combine juicy shrimp with colorful Mediterranean veggies, like cherry tomatoes and tangy artichoke, and top it off with a squeeze of lemon and a hearty sprinkle of feta cheese. 

Get Recipe

17. Easy Shrimp and Broccoli

This recipe is a family favorite and a healthy and easy weeknight meal. Cook up tender broccoli and juicy shrimp with soy sauce and rice vinegar. Depending on what you serve it with, dinner can be on the table in just 20 minutes!

Get Recipe

18. Shrimp Stir Fry

This shrimp stir fry recipe is versatile and customizable based on your tastes. All you need is shrimp, savory stir-fry sauce, and whatever veggies you love! Just add rice or noodles to make it a meal!

Get Recipe

19. Shrimp Bowl with Cilantro Lime Rice

This shrimp bowl recipe consistently gets 5-star reviews! Mix up a batch of cilantro lime rice, then top it with tender shrimp and a quick black bean and corn salad. The best part is the creamy, zingy chipotle ranch dressing goes on top of everything.

Get Recipe

20. Sheet Pan Shrimp Fajitas

Cooking dinner on one baking sheet in the oven never gets old. The shrimp is juicy and succulent, and everything is infused with an irresistible combination of spices. Wrap it up in a soft tortilla with lime crema, and it’s a total crowd pleaser!

Get Recipe

Print

How to Cook Frozen Shrimp

Sauteed shrimp

const share_pin_buttons = document.getElementsByClassName( ‘share-pin button’ );
if ( share_pin_buttons ) {
for ( let share_key = 0; share_key {
e.stopPropagation();
window.open(e.target.dataset.href,’targetWindow’,’toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=500,height=500′);
return false;
} );
}
}

5 Stars 4 Stars 3 Stars 2 Stars 1 Star

5 from 1 review

Cooking frozen shrimp is easier than you think! With my fool-proof method, you’ll have juicy, tender, and perfectly sautéed shrimp ready to serve in less than 10 minutes.

  • Author: Sonja Overhiser
  • Prep Time: 5 minutes
  • Cook Time: 5 minutes
  • Total Time: 10 minutes
  • Yield: 4
  • Category: Main dish
  • Method: Sauteed
  • Cuisine: Seafood
  • Diet: Gluten Free

Ingredients

  • 1 ½ pounds medium frozen shrimp, deveined (tail on or peeled)
  • ¾ teaspoon kosher salt
  • ¾ teaspoon smoked paprika (or substitute standard paprika)
  • ¾ teaspoon garlic powder
  • ¾ teaspoon onion powder
  • ¾ teaspoon cumin
  • 3 tablespoons butter or olive oil
  • 3 lemon wedges
  • Fresh cilantro or parsley, for garnish

Instructions

  1. Place the shrimp in a large bowl of very cold water for 15 minutes, stirring every 5 minutes to break up clumps that freeze together. (After 15 minutes, rinse off any remaining ice.)
  2. Pat the shrimp completely dry. 
  3. In a medium bowl, mix the shrimp with the salt, smoked paprika, garlic powder, onion powder, and cumin.
  4. In a large skillet, heat the butter on medium-high heat. Add the shrimp and cook for 1 to 2 minutes per side until just opaque and cooked through.
  5. Spritz with juice from the lemon wedges and serve immediately.

(function(){
window.addEventListener( ‘message’, function( event ){
if ( ( ‘https://nutrifox.com’ !== event.origin && ‘https://nutrifox.test’ !== event.origin ) ||
typeof event.data !== ‘string’ ) {
return;
}
var payload = JSON.parse( event.data );
switch ( payload.event ) {
case ‘setHeight’:
var iframe = document.getElementById( ‘nutrifox-label-‘ + payload.recipeId );
iframe.style.height = payload.height + ‘px’;
break;
}
} );
}());

Did you love this recipe?

Get our free newsletter with all of our best recipes!

window.trCommon={“minRating”:6,”ajaxurl”:”https:\/\/www.acouplecooks.com\/wp-admin\/admin-ajax.php”,”ratingNonce”:””,”postId”:132222};
window.TastyRecipes = window.TastyRecipes || {};

window.TastyRecipes.smoothScroll = {
init() {
window.addEventListener( ‘click’, e => {
let anchor = e.target;
if ( ! anchor.classList.contains( ‘tasty-recipes-scrollto’ ) ) {
if ( anchor.tagName === ‘A’ ) {
return;
}

anchor = anchor.closest( ‘a’ );
if ( ! anchor || ! anchor.classList.contains( ‘tasty-recipes-scrollto’ ) ) {
return;
}
}

const elementHref = anchor.getAttribute( ‘href’ );
if ( ! elementHref ) {
return;
}

e.preventDefault();
this.goToSelector( elementHref );
});
},
goToSelector( selector ) {
const element = document.querySelector( selector );
if ( ! element ) {
return;
}
element.scrollIntoView( { behavior: ‘smooth’ } );
history.pushState( {}, ”, selector );
}
};

(function( callback ) {
if ( document.readyState !== ‘loading’ ) {
callback();
} else {
window.addEventListener( ‘load’, callback );
}
})(() => {
window.TastyRecipes.smoothScroll.init();
});

window.TastyRecipes = window.TastyRecipes || {};
window.TastyRecipes.cookMode = {
wakeLockApi: false,
wakeLock: false,
cookModeSelector: ‘.tasty-recipes-cook-mode’,
init() {
if (“wakeLock” in navigator && “request” in navigator.wakeLock) {
this.wakeLockApi = navigator.wakeLock;
}

const cookModes = document.querySelectorAll(this.cookModeSelector);

if (cookModes.length > 0) {
for (const cookMode of cookModes) {
if (this.wakeLockApi) {
cookMode.querySelector(‘input[type=”checkbox”]’).addEventListener(“change”, event => {
this.checkboxChange(event.target);
}, false);
} else {
cookMode.style.display = “none”;
}
}
}
},
checkboxChange(checkbox) {
if (checkbox.checked) {
this.lock();
} else {
this.unlock();
}
},
setCheckboxesState(state) {
const checkboxes = document.querySelectorAll(this.cookModeSelector + ‘ input[type=”checkbox”]’);
for (const checkbox of checkboxes) {
checkbox.checked = state;
}
},
async lock() {
try {
this.wakeLock = await this.wakeLockApi.request(“screen”);
this.wakeLock.addEventListener(“release”, () => {
this.wakeLock = false;
this.setCheckboxesState(false);
});
this.setCheckboxesState(true);
} catch (error) {
this.setCheckboxesState(false);
}
},
unlock() {
if (this.wakeLock) {
this.wakeLock.release();
this.wakeLock = false;
}
this.setCheckboxesState(false);
}
};

(function(callback) {
if (document.readyState !== “loading”) {
callback();
} else {
document.addEventListener(“DOMContentLoaded”, callback);
}
})(() => {
window.TastyRecipes.cookMode.init();
});

window.TastyRecipes = window.TastyRecipes || {};

window.TastyRecipes.staticTooltip = {
element: null,
tooltipElement: null,
deleting: false,
init( element ) {
if ( this.deleting ) {
return;
}
this.element = element;
this.buildElements();
},
destroy() {
if ( ! this.tooltipElement || this.deleting ) {
return;
}

this.deleting = true;
this.tooltipElement.classList.remove( ‘opened’ );

setTimeout( () => {
this.tooltipElement.remove();
this.deleting = false;
}, 500 );
},
buildElements() {
const tooltipElement = document.createElement( ‘div’ );
tooltipElement.classList.add( ‘tasty-recipes-static-tooltip’);
tooltipElement.setAttribute( ‘id’, ‘tasty-recipes-tooltip’ );

const currentTooltipElement = document.getElementById( ‘tasty-recipes-tooltip’ );
if ( currentTooltipElement ) {
document.body.replaceChild( tooltipElement, currentTooltipElement );
} else {
document.body.appendChild( tooltipElement );
}

this.tooltipElement = document.getElementById( ‘tasty-recipes-tooltip’ );
},
show() {
if ( ! this.tooltipElement ) {
return;
}

const tooltipTop = this.element.getBoundingClientRect().top
+ window.scrollY
– 10 // 10px offset.
– this.tooltipElement.getBoundingClientRect().height;
const tooltipLeft = this.element.getBoundingClientRect().left
– ( this.tooltipElement.getBoundingClientRect().width / 2 )
+ ( this.element.getBoundingClientRect().width / 2 ) – 1;
const posLeft = Math.max( 10, tooltipLeft );
this.maybeRemoveTail( posLeft !== tooltipLeft );

this.tooltipElement.setAttribute( ‘style’, ‘top:’ + tooltipTop + ‘px;left:’ + posLeft + ‘px;’ );
this.tooltipElement.classList.add( ‘opened’ );

},
maybeRemoveTail( removeTail ) {
if ( removeTail ) {
this.tooltipElement.classList.add( ‘tr-hide-tail’ );
} else {
this.tooltipElement.classList.remove( ‘tr-hide-tail’ );
}
},
changeMessage( message ) {
if ( ! this.tooltipElement ) {
return;
}
this.tooltipElement.innerHTML = message;
}
};

window.TastyRecipes.ajax = {
sendPostRequest( url, data, success, failure ) {
const xhr = new XMLHttpRequest();
xhr.open( ‘POST’, url, true );
xhr.send( this.preparePostData( data ) );

xhr.onreadystatechange = () => {
if ( 4 !== xhr.readyState ) {
return;
}
if ( xhr.status === 200 ) {
success( JSON.parse( xhr.responseText ) );
return;
}

failure( xhr );
};

xhr.onerror = () => {
failure( xhr );
};
},
preparePostData( data ) {
const formData = new FormData();

for ( const key in data ) {
formData.append( key, data[key] );
}
return formData;
},
};

window.TastyRecipes.ratings = {
defaultRating: 0,
currentRatingPercentage: 100,
savingRating: false,
init( minRating ) {
this.minRating = minRating;

this.formWatchRating();
this.closeTooltipWhenClickOutside();
this.addBodyClassBasedOnSelectedRating();
this.backwardCompFormRatingPosition();
},
formWatchRating() {
const ratings = document.querySelectorAll(‘.tasty-recipes-no-ratings-buttons [data-rating]’);
if ( ratings.length {
event.preventDefault();
this.defaultRating = event.target.closest( ‘.checked’ ).dataset.rating;
this.setCheckedStar( event.target );
this.maybeSendRating( this.defaultRating, event.target );
this.setRatingInForm( this.defaultRating );
} );
}
},
closeTooltipWhenClickOutside() {
window.addEventListener( ‘click’, e => {
// Bailout (don’t remove the tooltip) when the clicked element is a rating star, or it’s the tooltip itself.
if ( e.target.closest( ‘.tasty-recipes-rating’ ) || e.target.classList.contains( ‘tasty-recipes-static-tooltip’ ) ) {
return;
}

window.TastyRecipes.staticTooltip.destroy();
} );
},
setRatingInForm( rating ) {
const ratingInput = document.querySelector( ‘#respond .tasty-recipes-rating[value=”‘ + rating + ‘”]’ );
if ( ! ratingInput ) {
return;
}
ratingInput.click();
},
addBodyClassBasedOnSelectedRating() {
const ratingInputs = document.querySelectorAll( ‘input.tasty-recipes-rating’ );
if ( ! ratingInputs ) {
return;
}
for ( const ratingInput of ratingInputs ) {
ratingInput.addEventListener( ‘click’, currentEvent => {
const selectedRating = currentEvent.target.getAttribute( ‘value’ );
this.handleBodyClassByRating( selectedRating );
this.toggleCommentTextareaRequired( selectedRating );
} );
}
},
handleBodyClassByRating( rating ) {
if ( rating < this.minRating ) {
document.body.classList.remove( 'tasty-recipes-selected-minimum-rating' );
return;
}
document.body.classList.add( 'tasty-recipes-selected-minimum-rating' );
},
toggleCommentTextareaRequired( rating ) {
const commentTextarea = document.getElementById( 'comment' );
if ( ! commentTextarea ) {
return;
}

if ( rating {
window.TastyRecipes.staticTooltip.changeMessage( response.data.message );
window.TastyRecipes.staticTooltip.show();
this.updateAverageText( response.data, recipeCardElement );
this.maybeFillCommentForm( response.data );

// Hide the tooltip after 5 seconds.
setTimeout( () => {
this.maybeResetTooltip( recipeCardElement, response.data, rating );
}, 5000 );
},
() => {
this.resetTooltip( recipeCardElement );
}
);
},
updateAverageText( data, recipeCardElement ) {
if ( ! data.average ) {
return;
}
this.setRatingPercent( data );

if ( ! data.count ) {
return;
}

const quickLink = document.querySelector( ‘.tasty-recipes-rating-link’ );
if ( quickLink ) {
this.setTextInContainer( quickLink, data );
this.setPartialStar( quickLink );
}

const cardStars = recipeCardElement.querySelector( ‘.tasty-recipes-ratings-buttons’ );
cardStars.dataset.trDefaultRating = data.average;
this.setTextInContainer( recipeCardElement.querySelector( ‘.tasty-recipes-rating’ ), data );
},
setTextInContainer( container, data ) {
if ( ! container ) {
return;
}

if ( data.label ) {
const ratingLabelElement = container.querySelector( ‘.rating-label’ );
if ( ratingLabelElement ) {
ratingLabelElement.innerHTML = data.label;
}
return;
}

const averageElement = container.querySelector( ‘.average’ );
if ( averageElement ) {
averageElement.textContent = data.average;
}

const countElement = container.querySelector( ‘.count’ );
if ( countElement ) {
countElement.textContent = data.count;
}
},
setPartialStar( container ) {
const highestStar = container.querySelector( ‘[data-rating=”‘ + Math.ceil( this.defaultRating ) + ‘”]’ );
if ( highestStar ) {
highestStar.dataset.trClip = this.currentRatingPercentage;
}
},
setRatingPercent( data ) {
this.defaultRating = data.average.toFixed( 1 );
const parts = data.average.toFixed( 2 ).toString().split( ‘.’ );
this.currentRatingPercentage = parts[1] ? parts[1] : 100;
if ( this.currentRatingPercentage === ’00’ ) {
this.currentRatingPercentage = 100;
}
},
setCheckedStar( target ) {
const cardRatingContainer = target.closest( ‘.tasty-recipes-ratings-buttons’ );
const selectedRatingElement = cardRatingContainer.querySelector( ‘[data-tr-checked]’ );
if ( selectedRatingElement ) {
delete selectedRatingElement.dataset.trChecked;
}

const thisStar = target.closest( ‘.tasty-recipes-rating’ );
thisStar.dataset.trChecked = 1;
thisStar.querySelector( ‘[data-tr-clip]’ ).dataset.trClip = 100;
},
maybeFillCommentForm( data ) {
if ( ! data.comment || ! data.comment.content ) {
return;
}

const commentForm = document.querySelector( ‘#commentform’ );
if ( ! commentForm ) {
return;
}

const commentBox = commentForm.querySelector( ‘[name=comment]’ );
if ( ! commentBox || commentBox.value ) {
return;
}

// Add comment details for editing.
commentBox.innerHTML = data.comment.content;
if ( data.comment.name ) {
commentForm.querySelector( ‘[name=author]’ ).value = data.comment.name;
commentForm.querySelector( ‘[name=email]’ ).value = data.comment.email;
}
},
maybeResetTooltip( recipeCardElement, data, rating ) {
if ( this.savingRating === rating ) {
this.resetTooltip( recipeCardElement, data );
}
},
resetTooltip( recipeCardElement, data ) {
window.TastyRecipes.staticTooltip.destroy();
this.savingRating = false;

// Reset the default rating.
const cardRatingContainer = recipeCardElement.querySelector( ‘.tasty-recipes-ratings-buttons’ );
if ( cardRatingContainer ) {
this.defaultRating = ( data && data.average ) ? data.average.toFixed(1) : cardRatingContainer.dataset.trDefaultRating;
cardRatingContainer.dataset.trDefaultRating = this.defaultRating;

this.resetSelectedStar( cardRatingContainer, data );
}
},
resetSelectedStar( cardRatingContainer ) {
const selectedRatingElement = cardRatingContainer.querySelector( ‘[data-rating=”‘ + Math.ceil( this.defaultRating ) + ‘”]’ );
if ( selectedRatingElement ) {
selectedRatingElement.querySelector( ‘[data-tr-clip]’ ).dataset.trClip = this.currentRatingPercentage;
selectedRatingElement.parentNode.dataset.trChecked = 1;
}

const previousSelectedElement= cardRatingContainer.querySelector( ‘[data-tr-checked]’ );
if ( previousSelectedElement ) {
const currentSelectedRating = previousSelectedElement.querySelector(‘[data-rating]’);
if ( currentSelectedRating !== selectedRatingElement ) {
delete previousSelectedElement.dataset.trChecked;
}
}
},
backwardCompFormRatingPosition() {
const ratingsButtons = document.querySelector( ‘#respond .tasty-recipes-ratings-buttons, #tasty-recipes-comment-rating .tasty-recipes-ratings-buttons’ );
if ( ! ratingsButtons ) {
return;
}
const ratingsButtonsStyles = window.getComputedStyle(ratingsButtons);
if ( ! ratingsButtonsStyles.display.includes( ‘flex’ ) ) {
ratingsButtons.style.direction = ‘rtl’;
}

if ( typeof tastyRecipesRating !== ‘undefined’ ) {
// Select the rating that was previously selected in admin.
ratingsButtons.querySelector( ‘.tasty-recipes-rating[value=”‘ + tastyRecipesRating + ‘”]’ ).checked = true;
}

const ratingSpans = ratingsButtons.querySelectorAll( ‘.tasty-recipes-rating’ );
for (const ratingSpan of ratingSpans) {
ratingSpan.addEventListener( ‘click’, event => {
if ( ratingSpan === event.target ) {
return;
}
ratingSpan.previousElementSibling.click();
} );
}
}
};

(function(callback) {
if (document.readyState !== “loading”) {
callback();
} else {
window.addEventListener( ‘load’, callback );
}
})(() => {
window.TastyRecipes.ratings.init( window.trCommon ? window.trCommon.minRating : 4 );
});

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments