0

I'd like to use the summary tag to summarise the content of a post, but I'm facing a couple of issues doing that:

  1. There isn't an option for it in the wysiwyg - how can I add elements to the format dropdown?

  2. Wordpress strips out the element when the editor loads, so saving the page again removes the tag. How can I whitelist <summary>?

0

You can use the $allowed_tags global. Add the following to your functions.php file.

global $allowedtags;
$allowedtags['summary'] = array('class' => array());

Add more attributes within the array similar to the class element. You can learn more on Otto's post here:

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.