Найди 2 отличия
<div id = "ptags" style="display:block">ptags</div>
<div class = "image_post_content" style="display:block">image_post_content</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script>
if ($("#ptags").css("display") != "none") {
$(".image_post_content").css("display","none");
} else {
$(".image_post_content").css("display","block");
}
</script>