Created
January 18, 2017 11:54
-
-
Save mklasen/dafab597b8e8cf5ed65ff3bece0c8d17 to your computer and use it in GitHub Desktop.
WordPress: Wrap content output in a div
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action('loop_start', function() { | |
// Only for archive | |
if (is_archive()) { | |
echo '<!--- Start loop wrap --><div class="wrap">'; | |
} | |
}); | |
add_action('loop_end', function() { | |
// Only for archive | |
if (is_archive()) { | |
echo '</div><!--- END loop wrap -->'; | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment