{"id":130,"date":"2013-01-10T08:00:19","date_gmt":"2013-01-10T08:00:19","guid":{"rendered":"http:\/\/pixert.com\/blog\/?p=130"},"modified":"2013-01-10T08:00:52","modified_gmt":"2013-01-10T08:00:52","slug":"enable-formatting-tags-for-content-limit-in-genesis-featured-posts-widget","status":"publish","type":"post","link":"https:\/\/pixert.com\/blog\/enable-formatting-tags-for-content-limit-in-genesis-featured-posts-widget\/","title":{"rendered":"Enable Formatting Tags for Content Limit in Genesis Featured Posts widget"},"content":{"rendered":"<p style=\"text-align: center\"><a href=\"http:\/\/pixert.com\/blog\/?attachment_id=281\" rel=\"attachment wp-att-281\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"281\" data-permalink=\"https:\/\/pixert.com\/blog\/enable-formatting-tags-for-content-limit-in-genesis-featured-posts-widget\/gallerygenesis\/\" data-orig-file=\"https:\/\/i0.wp.com\/pixert.com\/blog\/wp-content\/uploads\/2013\/01\/gallerygenesis.jpg?fit=600%2C340&amp;ssl=1\" data-orig-size=\"600,340\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}\" data-image-title=\"gallerygenesis\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/pixert.com\/blog\/wp-content\/uploads\/2013\/01\/gallerygenesis.jpg?fit=600%2C340&amp;ssl=1\" class=\"aligncenter  wp-image-281\" alt=\"gallerygenesis\" src=\"https:\/\/i0.wp.com\/pixert.com\/blog\/wp-content\/uploads\/2013\/01\/gallerygenesis.jpg?resize=400%2C200\" width=\"400\" height=\"200\" \/><\/a><\/p>\n<p>Genesis Framework has same function that return the content after trimming and it strips all HTML<br \/>\nThe following code help you keep or filter some HTML tags when you are using Content Limit in Theme Settings or Widgets (e.g Genesis &#8211; Featured Posts widget)<\/p>\n<p>Add following to functions.php in the Genesis Framework child theme<\/p>\n<pre class=\"brush: php; title: Code Block; notranslate\" title=\"Code Block\">\r\n\r\nadd_filter('get_the_content_limit_allowedtags', 'childtheme_custom_allowedtags');\r\nfunction childtheme_custom_allowedtags() {\r\nreturn '&amp;lt;script&amp;gt;,&amp;lt;style&amp;gt;,&amp;lt;b&amp;gt;,&amp;lt;br&amp;gt;,&amp;lt;em&amp;gt;'; \/\/add whatever tags you want to this string\r\n}\r\n\r\n<\/pre>\n<p>The code been tested on <a title=\"Gallery Child Theme for Genesis Framework\" href=\"http:\/\/www.mojo-themes.com\/item\/gallery-child-theme-genesis-framework\/\">Gallery Child Theme for Genesis Framework<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Genesis Framework has same function that return the content after trimming and it strips all HTML The following code help you keep or filter some HTML tags when you are using Content Limit in Theme Settings or Widgets (e.g Genesis &#8211; Featured Posts widget) Add following to functions.php in the Genesis Framework child theme add_filter(&#8216;get_the_content_limit_allowedtags&#8217;, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":281,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[54,5],"tags":[55,121,6],"class_list":["post-130","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-code-snippet","category-wordpress","tag-code-snippet-2","tag-genesis-framework","tag-wordpress-2"],"aioseo_notices":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/pixert.com\/blog\/wp-content\/uploads\/2013\/01\/gallerygenesis.jpg?fit=600%2C340&ssl=1","jetpack_shortlink":"https:\/\/wp.me\/p1pvi1-26","jetpack-related-posts":[{"id":268,"url":"https:\/\/pixert.com\/blog\/wordpress-limit-post\/","url_meta":{"origin":130,"position":0},"title":"WordPress Limit Post","author":"Pixel Insert \/ Pixert","date":"November 30, 2012","format":false,"excerpt":"This function controls the maximum\u00a0amount of characters displayed for an entry on the main page. If the set limit is surpassed, the text on the entry will be chopped\u00a0to that amount of characters, otherwise the content will be showed unchanged. Add following code to functions.php in your theme folder [php]\u2026","rel":"","context":"In &quot;Code Snippet&quot;","block_context":{"text":"Code Snippet","link":"https:\/\/pixert.com\/blog\/category\/code-snippet\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/pixert.com\/blog\/wp-content\/uploads\/2011\/03\/wordpresslogo-300x68.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":393,"url":"https:\/\/pixert.com\/blog\/add-facebook-like-box-change-language-local\/","url_meta":{"origin":130,"position":1},"title":"How to add Facebook Like Box and change language to local","author":"Pixel Insert \/ Pixert","date":"September 21, 2014","format":false,"excerpt":"Facebook Like Box\u00a0allows website owners to provide their visitors with an easy way to join their facebook community and get updates right in their Facebook news feed with a click to like from\u00a0their website. It\u00a0is\u00a0a good\u00a0way\u00a0to promote a \u00a0Facebook Page. Facebook Like Box only works for Facebook Pages, this isn't\u2026","rel":"","context":"In &quot;WordPress&quot;","block_context":{"text":"WordPress","link":"https:\/\/pixert.com\/blog\/category\/wordpress\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/pixert.com\/blog\/wp-content\/uploads\/2014\/09\/facebooklikebox.jpg?fit=447%2C547&ssl=1&resize=350%2C200","width":350,"height":200},"classes":[]},{"id":416,"url":"https:\/\/pixert.com\/blog\/wordpress-title-empty-on-index-page\/","url_meta":{"origin":130,"position":2},"title":"WordPress Title Empty on Index Page","author":"Pixel Insert \/ Pixert","date":"November 2, 2014","format":false,"excerpt":"Here's description from WordPress Codex about what happen when WordPress title empty when viewing index page\/ homepage If you are using a custom homepage with custom loops and stuff or a custom front-page, you will have an empty wp_title. I recently encountered this problem on a client's site. Homepage\/Index page\u2026","rel":"","context":"In &quot;Code Snippet&quot;","block_context":{"text":"Code Snippet","link":"https:\/\/pixert.com\/blog\/category\/code-snippet\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":447,"url":"https:\/\/pixert.com\/blog\/wordpress-randomize-posts-category-page\/","url_meta":{"origin":130,"position":3},"title":"WordPress: Randomize posts in a category page","author":"Pixel Insert \/ Pixert","date":"July 19, 2016","format":false,"excerpt":"The following lines of code change the way of displaying posts in a category page from default to date to random order. Please add following lines of code to functions.php [php] add_action( 'pre_get_posts', 'random_category_posts' ); function random_category_posts( $query ) { if ( $query-&gt;is_category() &amp;&amp; $query-&gt;is_main_query() ) { $query-&gt;set( 'orderby', 'rand'\u2026","rel":"","context":"In &quot;Code Snippet&quot;","block_context":{"text":"Code Snippet","link":"https:\/\/pixert.com\/blog\/category\/code-snippet\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":305,"url":"https:\/\/pixert.com\/blog\/wordpress-conditional-tag-to-check-specific-menu\/","url_meta":{"origin":130,"position":4},"title":"WordPress: Conditional tag to check a specific menu","author":"Pixel Insert \/ Pixert","date":"May 22, 2013","format":false,"excerpt":"Following conditional tag usually use in this filter function, wp_nav_menu_items [php]if( $args->theme_location == 'primary' )[\/php] \u00a0 [php]if( $args->theme_location == 'secondary' )[\/php] \u00a0 [php]if( $args->theme_location == 'primary' )[\/php] For an example, I want to add search box to Primary Menu in WPZOOM theme name Videozoom. Conditional tag above make sure the\u2026","rel":"","context":"In &quot;Code Snippet&quot;","block_context":{"text":"Code Snippet","link":"https:\/\/pixert.com\/blog\/category\/code-snippet\/"},"img":{"alt_text":"wordpress-logo-notext-rgb","src":"https:\/\/i0.wp.com\/pixert.com\/blog\/wp-content\/uploads\/2013\/08\/wordpress-logo-notext-rgb.jpg?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":279,"url":"https:\/\/pixert.com\/blog\/keep-html-tags-wordpress-limit-posts\/","url_meta":{"origin":130,"position":5},"title":"Keep HTML Tags in WordPress Limit Posts &#8211; the_content_limit","author":"Pixel Insert \/ Pixert","date":"January 8, 2013","format":false,"excerpt":"This function, the_content_limit \u00a0controls the maximum\u00a0amount of characters displayed for an entry on the main page on WordPress homepage posts, e.g Featured Posts, Recent Posts However , the_content_limit stripped HTML tags just like the_excerpt. What if we want to keep HTML tags We make modification to the function, the_content_limit which\u2026","rel":"","context":"In &quot;Code Snippet&quot;","block_context":{"text":"Code Snippet","link":"https:\/\/pixert.com\/blog\/category\/code-snippet\/"},"img":{"alt_text":"WordPress - the logo","src":"https:\/\/i0.wp.com\/pixert.com\/blog\/wp-content\/uploads\/2011\/03\/wordpresslogo-300x68.png?resize=350%2C200","width":350,"height":200},"classes":[]}],"jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/pixert.com\/blog\/wp-json\/wp\/v2\/posts\/130","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pixert.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pixert.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pixert.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pixert.com\/blog\/wp-json\/wp\/v2\/comments?post=130"}],"version-history":[{"count":0,"href":"https:\/\/pixert.com\/blog\/wp-json\/wp\/v2\/posts\/130\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/pixert.com\/blog\/wp-json\/wp\/v2\/media\/281"}],"wp:attachment":[{"href":"https:\/\/pixert.com\/blog\/wp-json\/wp\/v2\/media?parent=130"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pixert.com\/blog\/wp-json\/wp\/v2\/categories?post=130"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pixert.com\/blog\/wp-json\/wp\/v2\/tags?post=130"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}