To escape html content you can use wp_kses
function.
$allowed = array(
'li' => array(),
'a' => array(
'href' => true,
),
);
echo wp_kses('<li><a href="#" target="_blank">Category</a></li>', $allowed);
If you do not want to pass allowed array you can use default WordPress array for post content which is used in wp_kses_post
function.
echo wp_kses_post('<li><a href="#" target="_blank">Category</a></li>');
Related Posts:
- How to add posts to custom menus?
- How to add custom css file in theme?
- CSS not updating in browser when I change it
- How to remove search bar from a wordpress theme? [closed]
- Get url of thumbnail from the media uploader
- How to: Update live sites theme from version control repo via plugin or library? [closed]
- Best practice way to implement custom sections into a WordPress theme
- Adding items to page template dropdown on Page Edit Screen
- How to use logout function on custom menu link?
- How to customize wordpress login/register pages?
- Hide certain pages / posts on wp-admin, show custom filter
- use add_action(‘wp_head’) in a widget for generating dynamic CSS styles
- Front End Post Submit Form
- Page attribute template dropdown not displayed even the syntax is correct
- How to add a text widget during theme activation
- WordPress Theme customisation CSS
- Displaying wp menus by name without using theme locations
- Why does this loop only work on the homepage?
- Nesting Functions within Functions
- De-registering parent style sheet css recommended?
- inserting custom li class to wp_list_pages
- Theme check: Missing a text-domain
- Can I customize any WordPress parent block-based theme template files by child theme like a parent classic theme?
- How to determine if post has widget content?
- Custom Script Section Only Echoes Text
- Free starter theme to make mobile websites? [closed]
- WP Customize refresh problem
- Set multiple templates per post
- Place the page title into the short code
- My javascript jquery won’t work?
- Displaying recent post excerpts on static front page
- How to check if a WordPress core block is active in sidebar
- approach to pass additional parameter in post URL
- Which html elements should be styled in wordpress theme
- wp_remote_get times out on api request but jquery GET and postman work?
- Folder name for a pro version of a WordPress.org theme?
- WordPress Media Uploader in page template (On Front-end)
- Using WordPress’ Theme Customizer to select page templates that update layout in the preview
- Theme Customizer not loading JS for live preview
- Replace function in a child theme
- get_search_form() and aria_label
- Can’t remove DIV from hooks in Storefront child theme [closed]
- Admin: sub menu doesnt display under apperance when activate my themes
- How to register and enqueue JavaScript files without breaking plugin dependencies?
- How can I specify that an area of my theme contains widgets?
- How to dequeue css files?
- Extract all shortcode data from post into loop variables?
- wp_nav_menu and its fallback
- Adding the_content() return warning count()
- Copying the theme style files and images to duplicate the website but with a difference
- How to enqueue a script which is type module without using script_loader_tag filter?
- How to set Post meta-box defaults based on the choices made by user in Customizer?
- Twenty Seventeen Pages Loop
- What and where are the WordPress core-bundled scripts?
- How to add pages in wordpress using codes?
- How does the loop know which post to view?
- add jquery file if a certain page is included
- How to remove permalinks links presents in each page of my site?
- How do I get from search_theme_directories() to the $stylesheet (name) for switch_theme()
- Tabbed theme options query about add_settings_section callback function
- How to use multiple check-box values to work in a function and insert values in database
- How to make a function occurs for one time?
- How to know if I am on 1st page
- Archives and Categories in Custom Menu
- How to create a robust and logic class naming system in WordPress theme developing?
- How to render block editor in wp-admin custom pages programmatically
- How to enable admin to upload multiple images to support header carousel slider theme in WordPress?
- how to change footer content for certain pages only
- function ‘theme_settings_page’ not found
- Fetch data from database with dropdown selected option
- How do I keep my iframes responsive and scaled to fit their container?
- I don’t know why categories are showing below post
- Is there a way to create sections under “Colors” panel in the Theme Customizer?
- Need help with adding custom wordpress menu and sub-menu
- get currently showed author ID in theme functions.php
- WordPress Custom font not found
- How do I control the header space in non-front pages in Twenty Seventeen?
- Target second from last post in loop
- How to load mediaelement.js in theme template?
- Full width thumbnail
- Customizer API way function is_customize_preview() works only in main page?
- Advantages/Disadvantages Using Theme Editor Instead of Pages
- Magnific Popup – Add Caption to Images
- Why do WordPress developers use so many opening and closing PHP tags when developing themes? [duplicate]
- using theme check plugin to remove waring and errors from my theme
- paragraph format in WYSIWYG on a custom theme?
- unable to display the image meta value as background
- editor style css and page template with and without sidebar
- 3 x 3 grid of posts on the home page
- Suppress the_content filter in a nested loop
- How to update my own theme?
- trying to figure out how to use more that one image upload in the same section in theme customizer
- The normal loop with different styles doesn’t work in search.php
- Pass custom css class to add_menu_page
- URL conflict with a ‘Single Page Layout’
- loading custom.js file after jquery is loaded
- How to force unlink on attached/inserted images?
- How to determine if it is legal to remove credit link from theme?
- Display recent posts on front page
- How to create sub-menu in “Allure Real Estate Theme for Placester”?