{"id":222,"date":"2012-04-06T04:16:49","date_gmt":"2012-04-06T04:16:49","guid":{"rendered":"http:\/\/pixert.com\/blog\/?p=222"},"modified":"2012-04-06T04:16:49","modified_gmt":"2012-04-06T04:16:49","slug":"wpzoom-featured-category-widget-videozoom","status":"publish","type":"post","link":"https:\/\/pixert.com\/blog\/wpzoom-featured-category-widget-videozoom\/","title":{"rendered":"WPZoom Featured Category Widget with video for Videozoom theme"},"content":{"rendered":"<p>I made the following widget code to show Featured Category with Video embed code.<br \/>\nThe following widget works with Videozoom theme from WPZoom<\/p>\n<p>Open wpzoom-widgets.php in the functions folder of Videozom. \u00a0Add the following code at the bottom of the wpzoom-widgets.php<\/p>\n<pre class=\"brush: php; title: Code Block; notranslate\" title=\"Code Block\">\r\n\/*---------------------------------------------*\/\r\n\/* WPZOOM: Featured Category widget with Video *\/\r\n\/*---------------------------------------------*\/\r\nadd_action('widgets_init', create_function('', 'return register_widget(&quot;wpzoom_widget_fea_cat_video_posts&quot;);'));\r\nclass wpzoom_widget_fea_cat_video_posts extends WP_Widget {\r\n\r\n\/* Widget setup. *\/\r\nfunction wpzoom_widget_fea_cat_video_posts() {\r\n\t\/* Widget settings. *\/\r\n\t$widget_ops = array( 'classname' =&gt; 'wpzoom', 'description' =&gt; __('Featured Category Widget', 'wpzoom') );\r\n\r\n\t\/* Widget control settings. *\/\r\n\t$control_ops = array( 'width' =&gt; 250, 'height' =&gt; 350, 'id_base' =&gt; 'wpzoom-widget-cat' );\r\n\r\n\t\/* Create the widget. *\/\r\n\t$this-&gt;WP_Widget( 'wpzoom-widget-cat', __('WPZOOM: Featured Category', 'wpzoom'), $widget_ops, $control_ops );\r\n}\r\n\r\n\/* How to display the widget on the screen. *\/\r\nfunction widget( $args, $instance ) {\r\n\r\n\textract( $args );\r\n\r\n\t\/* Our variables from the widget settings. *\/\r\n\t$title1 = apply_filters('widget_title', $instance&#x5B;'title1'] );\r\n\t$posts1 = $instance&#x5B;'posts1'];\r\n\t$category1 = get_category($instance&#x5B;'category1']);\r\n\tif ($category1) {\r\n\t\t$categoryLink1 = get_category_link($category1);\r\n\t}\r\n\t$videowidth = $instance&#x5B;'videowidth'];\r\n  $videoheight = $instance&#x5B;'videoheight'];\r\n\techo $before_widget;\r\n\techo &quot;$before_title&quot;.&quot;$title1&quot;.&quot;$after_title&quot;; ?&gt;\r\n\r\n\t&lt;ul class=&quot;posts&quot;&gt;\r\n\r\n\t\t&lt;?php\r\n\t\t$args = array('showposts' =&gt; $posts1, 'orderby' =&gt; 'date', 'order' =&gt; 'DESC', 'cat' =&gt; $instance&#x5B;'category1']);\r\n\t\tquery_posts($args);\r\n\t\tglobal $options;\r\nforeach ($options as $value) {\r\nif (get_settings( $value&#x5B;'id'] ) === FALSE) { $$value&#x5B;'id'] = $value&#x5B;'std']; } else { $$value&#x5B;'id'] = get_settings( $value&#x5B;'id'] ); }\r\n}\r\n\r\n    while (have_posts()) : the_post(); ?&gt;\r\n\r\n\t\t&lt;li&gt;\r\n\t\t\t&lt;?php global $post;\r\n\t\t\tunset($videocode); $videocode = get_post_meta($post-&gt;ID, 'wpzoom_post_embed_code', true);\r\n\t\t    $video_hd = get_post_meta($post-&gt;ID, 'wpzoom_post_embed_hd', true);\r\n        if (strlen($videocode) &gt; 1) { \/\/ Do we embed a video from a website?\r\n\t\t\t\t$videocode = preg_replace(&quot;\/(width\\s*=\\s*&#x5B;\\&quot;\\'])&#x5B;0-9]+(&#x5B;\\&quot;\\'])\/i&quot;, &quot;$1 $videowidth $2&quot;, $videocode);\r\n\t\t\t\t$videocode = preg_replace(&quot;\/(height\\s*=\\s*&#x5B;\\&quot;\\'])&#x5B;0-9]+(&#x5B;\\&quot;\\'])\/i&quot;, &quot;$1 $videoheight $2&quot;, $videocode);\r\n\t\t\t\t$videocode = str_replace(&quot;&lt;embed&quot;,&quot;&lt;param name='wmode' value='transparent'&gt;&lt;\/param&gt;&lt;embed&quot;,$videocode);\r\n\t\t\t\t$videocode = str_replace(&quot;&lt;embed&quot;,&quot;&lt;embed wmode='transparent' &quot;,$videocode); ?&gt;\r\n\t\t  &lt;div class=&quot;cover&quot;&gt;&lt;?php echo &quot;$videocode&quot;; ?&gt;&lt;\/div&gt;\r\n      &lt;?php } elseif  (strlen($videocode) &lt; 1) {\r\n\t\t\t\tunset($videocode); $videocode = get_post_meta($post-&gt;ID, 'wpzoom_post_embed_self', true);\r\n\t\t\t\tif (strlen($videocode) &gt; 1) { \/\/ Let's embed a self-hosted video!\r\n\t\t\t\t$skin = strtolower(get_post_meta($post-&gt;ID, 'wpzoom_post_embed_skin', true));\r\n\t\t\t?&gt;\r\n\t\t\t&lt;div class=&quot;cover&quot;&gt;\r\n\t\t\t&lt;div id='video_&lt;?php echo the_ID() ; ?&gt;'&gt;Video&lt;\/div&gt;\r\n\t\t\t\t\t&lt;script type='text\/javascript'&gt;\r\n\t\t\t\t\t  jwplayer('video_&lt;?php echo the_ID();  ?&gt;').setup({\r\n\t\t\t\t\t\t'file': '&lt;?php echo &quot;$videocode&quot;; ?&gt;',\r\n\t\t\t\t\t\t'skin': '&lt;?php bloginfo('template_directory'); ?&gt;\/js\/skins\/&lt;?php echo &quot;$skin\/$skin.zip&quot;; ?&gt;',\r\n\t\t\t\t\t\t'image' : '&lt;?php echo &quot;$img&quot;; ?&gt;',\r\n\t\t\t\t\t\t'width': '&lt;?php echo &quot;$videowidth&quot;; ?&gt;',\r\n\t\t\t\t\t\t'height': '&lt;?php echo &quot;$videoheight&quot;; ?&gt;',\r\n \t\t\t\t\t\t&lt;?php if (strlen($video_hd) &gt; 1) { ?&gt;'plugins': {\r\n\t\t\t\t\t\t   'hd-1': {\r\n\t\t\t\t\t\t\t   'file': '&lt;?php echo &quot;$video_hd&quot;; ?&gt;'\r\n\t\t\t\t\t\t   }\r\n\t\t\t\t\t\t}, &lt;?php } ?&gt;\r\n\t\t\t\t\t\t'modes': &#x5B;\r\n \t\t\t\t\t\t\t{type: 'flash', src: '&lt;?php bloginfo('template_directory'); ?&gt;\/js\/player.swf'},\r\n \t\t\t\t\t\t\t{type: 'html5'}\r\n\t\t\t\t\t\t]\r\n\t\t\t\t\t  });\r\n\t\t\t\t\t&lt;\/script&gt;\r\n\t\t\t\t&lt;\/div&gt;\r\n\t\t\t&lt;?php } } if (!$videocode) { \/\/ No video? Show a picture then\r\n\t\t\tunset($img);\r\n\t\t\tif ( current_theme_supports( 'post-thumbnails' ) &amp;&amp; has_post_thumbnail() ) {\r\n\t\t\t\t$thumbURL = wp_get_attachment_image_src( get_post_thumbnail_id($post-&gt;ID), '' );\r\n\t\t\t$img = $thumbURL&#x5B;0];  }\r\n\t\t\telse {\r\n\t\t\t\tunset($img);\r\n\t\t\t\tif ($wpzoom_cf_use == 'Yes')  { $img = get_post_meta($post-&gt;ID, $wpzoom_cf_photo, true); }\r\n\t\t\t\telse {\r\n\t\t\t\t\tif (!$img)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$img = catch_that_image($post-&gt;ID);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif ($img) : $img = wpzoom_wpmu($img); ?&gt;\r\n\t\t\t&lt;div class=&quot;cover&quot;&gt;&lt;a href=&quot;&lt;?php the_permalink(); ?&gt;&quot; rel=&quot;bookmark&quot; title=&quot;&lt;?php the_title(); ?&gt;&quot;&gt;&lt;img src=&quot;&lt;?php bloginfo('template_directory'); ?&gt;\/scripts\/timthumb.php?src=&lt;?php echo $img ?&gt;&amp;amp;h=45&amp;amp;w=60&amp;amp;zc=1&quot; alt=&quot;&lt;?php the_title(); ?&gt;&quot; \/&gt;&lt;\/a&gt;&lt;\/div&gt;\r\n\t\t\t&lt;?php endif; } ?&gt;\r\n\t\t\t&lt;a href=&quot;&lt;?php the_permalink() ?&gt;&quot; title=&quot;&lt;?php the_title(); ?&gt;&quot;&gt;&lt;?php the_title(); ?&gt;&lt;\/a&gt;\r\n\t\t\t&lt;p class=&quot;postmetadata&quot;&gt; &lt;a href=&quot;&lt;?php the_permalink() ?&gt;#commentspost&quot; title=&quot;Jump to the comments&quot;&gt;&lt;?php comments_number('0 comments','1 comment','% comments'); ?&gt;&lt;\/a&gt;&lt;\/p&gt;\r\n\t\t\t&lt;div class=&quot;cleaner&quot;&gt;&amp;nbsp;&lt;\/div&gt;\r\n\t\t&lt;\/li&gt;\r\n\r\n\t\t&lt;?php endwhile; wp_reset_query(); ?&gt;\r\n\r\n\t&lt;\/ul&gt;&lt;!-- end .posts --&gt;\r\n\r\n\t&lt;?php\r\n\r\n\techo $after_widget;\r\n\r\n\twp_reset_query();\r\n\r\n\t}\r\n\r\n\t\/* Update the widget settings.*\/\r\n\tfunction update( $new_instance, $old_instance ) {\r\n\t\t$instance = $old_instance;\r\n\r\n\t\t\/* Strip tags for title and name to remove HTML (important for text inputs). *\/\r\n\t\t$instance&#x5B;'title1'] = strip_tags( $new_instance&#x5B;'title1'] );\r\n \t\t$instance&#x5B;'category1'] = $new_instance&#x5B;'category1'];\r\n\t\t$instance&#x5B;'posts1'] = $new_instance&#x5B;'posts1'];\r\n    $instance&#x5B;'videowidth'] = $new_instance&#x5B;'videowidth'];\r\n    $instance&#x5B;'videoheight'] = $new_instance&#x5B;'videoheight'];\r\n\t\treturn $instance;\r\n\t}\r\n\r\n\t\/** Displays the widget settings controls on the widget panel.\r\n\t * Make use of the get_field_id() and get_field_name() function when creating your form elements. This handles the confusing stuff. *\/\r\n\tfunction form( $instance ) {\r\n\r\n\t\t\/* Set up some default widget settings. *\/\r\n\t\t$defaults = array( 'title1' =&gt; __('Featured Posts', 'wpzoom'), 'category1' =&gt; '0', 'posts1' =&gt; '3' );\r\n\t\t$instance = wp_parse_args( (array) $instance, $defaults );\r\n    ?&gt;\r\n\r\n \t\t&lt;p&gt;\r\n\t\t\t&lt;label for=&quot;&lt;?php echo $this-&gt;get_field_id( 'title1' ); ?&gt;&quot;&gt;&lt;?php _e('Widget Title:', 'wpzoom'); ?&gt;&lt;\/label&gt;\r\n\t\t\t&lt;input class=&quot;widefat&quot; id=&quot;&lt;?php echo $this-&gt;get_field_id( 'title1' ); ?&gt;&quot; name=&quot;&lt;?php echo $this-&gt;get_field_name( 'title1' ); ?&gt;&quot; value=&quot;&lt;?php echo $instance&#x5B;'title1']; ?&gt;&quot; style=&quot;width:90%;&quot; \/&gt;\r\n\t\t&lt;\/p&gt;\r\n\r\n\t\t&lt;p&gt;\r\n\t\t\t&lt;label for=&quot;&lt;?php echo $this-&gt;get_field_id('category1'); ?&gt;&quot;&gt;&lt;?php _e('Category:', 'wpzoom'); ?&gt;&lt;\/label&gt;\r\n\t\t\t&lt;select id=&quot;&lt;?php echo $this-&gt;get_field_id('category1'); ?&gt;&quot; name=&quot;&lt;?php echo $this-&gt;get_field_name('category1'); ?&gt;&quot; style=&quot;width:90%;&quot;&gt;\r\n\t\t\t\t&lt;option value=&quot;0&quot;&gt;Choose category:&lt;\/option&gt;\r\n\t\t\t\t&lt;?php\r\n\t\t\t\t$cats = get_categories('hide_empty=0');\r\n\r\n\t\t\t\tforeach ($cats as $cat) {\r\n\t\t\t\t$option = '&lt;option value=&quot;'.$cat-&gt;term_id;\r\n\t\t\t\tif ($cat-&gt;term_id == $instance&#x5B;'category1']) { $option .='&quot; selected=&quot;selected';}\r\n\t\t\t\t$option .= '&quot;&gt;';\r\n\t\t\t\t$option .= $cat-&gt;cat_name;\r\n\t\t\t\t$option .= ' ('.$cat-&gt;category_count.')';\r\n\t\t\t\t$option .= '&lt;\/option&gt;';\r\n\t\t\t\techo $option;\r\n\t\t\t\t}\r\n\t\t\t?&gt;\r\n\t\t\t&lt;\/select&gt;\r\n\t\t&lt;\/p&gt;\r\n\r\n\t\t&lt;p&gt;\r\n\t\t\t&lt;label for=&quot;&lt;?php echo $this-&gt;get_field_id('posts1'); ?&gt;&quot;&gt;&lt;?php _e('Number of posts to show:', 'wpzoom'); ?&gt;&lt;\/label&gt;\r\n\t\t\t&lt;select id=&quot;&lt;?php echo $this-&gt;get_field_id('posts1'); ?&gt;&quot; name=&quot;&lt;?php echo $this-&gt;get_field_name('posts1'); ?&gt;&quot; style=&quot;width:90%;&quot;&gt;\r\n\t\t\t&lt;?php\r\n\t\t\t\t$m = 0;\r\n\t\t\t\twhile ($m &lt; 11) {\r\n\t\t\t\t$m++;\r\n\t\t\t\t$option = '&lt;option value=&quot;'.$m;\r\n\t\t\t\tif ($m == $instance&#x5B;'posts1']) { $option .='&quot; selected=&quot;selected';}\r\n\t\t\t\t$option .= '&quot;&gt;';\r\n\t\t\t\t$option .= $m;\r\n\t\t\t\t$option .= '&lt;\/option&gt;';\r\n\t\t\t\techo $option;\r\n\t\t\t\t}\r\n\t\t\t?&gt;\r\n\t\t\t&lt;\/select&gt;\r\n\t\t&lt;\/p&gt;\r\n\r\n\t\t&lt;p&gt;\r\n\t\t\t&lt;label for=&quot;&lt;?php echo $this-&gt;get_field_id( 'videowidth' ); ?&gt;&quot;&gt;&lt;?php _e('Video Width:', 'wpzoom'); ?&gt;&lt;\/label&gt;\r\n\t\t\t&lt;input class=&quot;widefat&quot; id=&quot;&lt;?php echo $this-&gt;get_field_id( 'videowidth' ); ?&gt;&quot; name=&quot;&lt;?php echo $this-&gt;get_field_name( 'videowidth' ); ?&gt;&quot; value=&quot;&lt;?php echo $instance&#x5B;'videowidth']; ?&gt;&quot; style=&quot;width:90%;&quot; \/&gt;\r\n\t\t&lt;\/p&gt;\r\n\r\n\t\t&lt;p&gt;\r\n\t\t\t&lt;label for=&quot;&lt;?php echo $this-&gt;get_field_id( 'videoheight' ); ?&gt;&quot;&gt;&lt;?php _e('Video Height:', 'wpzoom'); ?&gt;&lt;\/label&gt;\r\n\t\t\t&lt;input class=&quot;widefat&quot; id=&quot;&lt;?php echo $this-&gt;get_field_id( 'videoheight' ); ?&gt;&quot; name=&quot;&lt;?php echo $this-&gt;get_field_name( 'videoheight' ); ?&gt;&quot; value=&quot;&lt;?php echo $instance&#x5B;'videoheight']; ?&gt;&quot; style=&quot;width:90%;&quot; \/&gt;\r\n\t\t&lt;\/p&gt;\r\n\r\n\t&lt;?php\r\n\t}\r\n}\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>I made the following widget code to show Featured Category with Video embed code. The following widget works with Videozoom theme from WPZoom Open wpzoom-widgets.php in the functions folder of Videozom. \u00a0Add the following code at the bottom of the wpzoom-widgets.php \/*&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;*\/ \/* WPZOOM: Featured Category widget with Video *\/ \/*&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;*\/ add_action(&#8216;widgets_init&#8217;, create_function(&#8221;, &#8216;return register_widget(&quot;wpzoom_widget_fea_cat_video_posts&quot;);&#8217;)); [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","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":[97,96,6,7],"class_list":["post-222","post","type-post","status-publish","format-standard","hentry","category-code-snippet","category-wordpress","tag-videzoom","tag-widgets","tag-wordpress-2","tag-wp"],"aioseo_notices":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p1pvi1-3A","jetpack-related-posts":[{"id":218,"url":"https:\/\/pixert.com\/blog\/how-to-fix-custom-field-for-thumbnails-wpzoom-featured-category-widget\/","url_meta":{"origin":222,"position":0},"title":"How to fix Custom Field for thumbnails in WPZoom Featured Category widget","author":"Pixel Insert \/ Pixert","date":"April 6, 2012","format":false,"excerpt":"WPZoom Featured Widget is a widget built inside WPZOOM themes to show Featured Category posts The widget display thumbnail images, post titles and post meta datas from selected Featured Category There's a bug in wpzoom-widgets.php where as all widgets code are. The widget cannot display thumbnail images from custom field\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\/2012\/04\/featuredcat-208x300.jpg?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":284,"url":"https:\/\/pixert.com\/blog\/how-to-add-show-thumbnail-option-in-wpzoom-featured-category-widget\/","url_meta":{"origin":222,"position":1},"title":"How to add &#8216;Show Thumbnail&#8217; option in WPZOOM Featured Category Widget","author":"Pixel Insert \/ Pixert","date":"February 18, 2013","format":false,"excerpt":"Tribune is a lovely magazine theme from WPZOOM. The theme has custom widgets name WPZOOM Featured Category Widget You could use this widget to display categories on homepage like the demo site\u00a0(Politics - World - Sports - Automotive). The widget show thumbnails by default, it doesn't have feature to disable\u2026","rel":"","context":"In &quot;Code Snippet&quot;","block_context":{"text":"Code Snippet","link":"https:\/\/pixert.com\/blog\/category\/code-snippet\/"},"img":{"alt_text":"WPZOOMFeaturedCategory","src":"https:\/\/i0.wp.com\/pixert.com\/blog\/wp-content\/uploads\/2013\/02\/WPZOOMFeaturedCategory.jpg?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":256,"url":"https:\/\/pixert.com\/blog\/exclude-featured-posts-from-wpzoom-featured-category-widget\/","url_meta":{"origin":222,"position":2},"title":"Exclude Featured Posts from WPZOOM: Featured Category Widget","author":"Pixel Insert \/ Pixert","date":"August 25, 2012","format":false,"excerpt":"Zenko WPZOOM Demo Site (see the documentation) I made customization to the widget to exclude Same Posts already been shown on Featured Slider to avoid duplication 1. Open featured-category.php in wp-content\/themes\/zenko\/functions\/theme\/widgets folder 2. Replace all code in featured-category.php with the following [code] <?php \/*------------------------------------------*\/ \/* WPZOOM: Featured Category widget *\/\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\/2012\/08\/zenkofeapostswidget.jpg?fit=580%2C459&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/pixert.com\/blog\/wp-content\/uploads\/2012\/08\/zenkofeapostswidget.jpg?fit=580%2C459&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/pixert.com\/blog\/wp-content\/uploads\/2012\/08\/zenkofeapostswidget.jpg?fit=580%2C459&ssl=1&resize=525%2C300 1.5x"},"classes":[]},{"id":546,"url":"https:\/\/pixert.com\/blog\/the-importance-of-child-theme-in-wordpress\/","url_meta":{"origin":222,"position":3},"title":"The importance of Child Theme in WordPress","author":"Pixel Insert \/ Pixert","date":"March 4, 2021","format":false,"excerpt":"I've been using WordPress for a very long time and one of the things I have and will do is customize themes. I'm writing this because I was lazy to use a child theme for my main site. As a result, I had to enter the Slideshow code every time\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\/2021\/03\/618F75E4-2D1B-4A2B-B95D-37A990FB1A7A.jpeg?fit=933%2C1200&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/pixert.com\/blog\/wp-content\/uploads\/2021\/03\/618F75E4-2D1B-4A2B-B95D-37A990FB1A7A.jpeg?fit=933%2C1200&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/pixert.com\/blog\/wp-content\/uploads\/2021\/03\/618F75E4-2D1B-4A2B-B95D-37A990FB1A7A.jpeg?fit=933%2C1200&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/pixert.com\/blog\/wp-content\/uploads\/2021\/03\/618F75E4-2D1B-4A2B-B95D-37A990FB1A7A.jpeg?fit=933%2C1200&ssl=1&resize=700%2C400 2x"},"classes":[]},{"id":305,"url":"https:\/\/pixert.com\/blog\/wordpress-conditional-tag-to-check-specific-menu\/","url_meta":{"origin":222,"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":130,"url":"https:\/\/pixert.com\/blog\/enable-formatting-tags-for-content-limit-in-genesis-featured-posts-widget\/","url_meta":{"origin":222,"position":5},"title":"Enable Formatting Tags for Content Limit in Genesis Featured Posts widget","author":"Pixel Insert \/ Pixert","date":"January 10, 2013","format":false,"excerpt":"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 - Featured Posts widget) Add following to functions.php in 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":"","src":"https:\/\/i0.wp.com\/pixert.com\/blog\/wp-content\/uploads\/2013\/01\/gallerygenesis.jpg?fit=600%2C340&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/pixert.com\/blog\/wp-content\/uploads\/2013\/01\/gallerygenesis.jpg?fit=600%2C340&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/pixert.com\/blog\/wp-content\/uploads\/2013\/01\/gallerygenesis.jpg?fit=600%2C340&ssl=1&resize=525%2C300 1.5x"},"classes":[]}],"jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/pixert.com\/blog\/wp-json\/wp\/v2\/posts\/222","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=222"}],"version-history":[{"count":0,"href":"https:\/\/pixert.com\/blog\/wp-json\/wp\/v2\/posts\/222\/revisions"}],"wp:attachment":[{"href":"https:\/\/pixert.com\/blog\/wp-json\/wp\/v2\/media?parent=222"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pixert.com\/blog\/wp-json\/wp\/v2\/categories?post=222"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pixert.com\/blog\/wp-json\/wp\/v2\/tags?post=222"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}