{"id":284,"date":"2013-02-18T11:18:13","date_gmt":"2013-02-18T11:18:13","guid":{"rendered":"http:\/\/pixert.com\/blog\/?p=284"},"modified":"2013-02-18T11:18:13","modified_gmt":"2013-02-18T11:18:13","slug":"how-to-add-show-thumbnail-option-in-wpzoom-featured-category-widget","status":"publish","type":"post","link":"https:\/\/pixert.com\/blog\/how-to-add-show-thumbnail-option-in-wpzoom-featured-category-widget\/","title":{"rendered":"How to add &#8216;Show Thumbnail&#8217; option in WPZOOM Featured Category Widget"},"content":{"rendered":"<p><a href=\"http:\/\/www.wpzoom.com\/members\/go.php?r=978&amp;i=l60\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"287\" data-permalink=\"https:\/\/pixert.com\/blog\/how-to-add-show-thumbnail-option-in-wpzoom-featured-category-widget\/wpzoomfeaturedcategory\/\" data-orig-file=\"https:\/\/i0.wp.com\/pixert.com\/blog\/wp-content\/uploads\/2013\/02\/WPZOOMFeaturedCategory.jpg?fit=307%2C470&amp;ssl=1\" data-orig-size=\"307,470\" 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=\"WPZOOMFeaturedCategory\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/pixert.com\/blog\/wp-content\/uploads\/2013\/02\/WPZOOMFeaturedCategory.jpg?fit=195%2C300&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/pixert.com\/blog\/wp-content\/uploads\/2013\/02\/WPZOOMFeaturedCategory.jpg?fit=307%2C470&amp;ssl=1\" class=\"alignleft size-full wp-image-287\" alt=\"WPZOOMFeaturedCategory\" src=\"https:\/\/i0.wp.com\/pixert.com\/blog\/wp-content\/uploads\/2013\/02\/WPZOOMFeaturedCategory.jpg?resize=307%2C470\" width=\"307\" height=\"470\" srcset=\"https:\/\/i0.wp.com\/pixert.com\/blog\/wp-content\/uploads\/2013\/02\/WPZOOMFeaturedCategory.jpg?w=307&amp;ssl=1 307w, https:\/\/i0.wp.com\/pixert.com\/blog\/wp-content\/uploads\/2013\/02\/WPZOOMFeaturedCategory.jpg?resize=195%2C300&amp;ssl=1 195w\" sizes=\"auto, (max-width: 307px) 100vw, 307px\" \/><\/a><a title=\"Tribune Theme\" href=\"http:\/\/www.wpzoom.com\/members\/go.php?r=978&amp;i=l60\">Tribune<\/a> is a lovely magazine theme from WPZOOM. The theme has custom widgets name WPZOOM Featured Category Widget<br \/>\nYou could use this widget to display categories on homepage like <a title=\"Tribune theme\" href=\"http:\/\/www.wpzoom.com\/members\/go.php?r=978&amp;i=l60\">the demo site<\/a>\u00a0(Politics &#8211; World &#8211; Sports &#8211; Automotive). The widget show thumbnails by default, it doesn&#8217;t have feature to disable that. What if you want a feature that allow you to show thumbnails for a category, but not for others.<br \/>\nIt takes a little bit customization to WPZOOM Featured Category Widget<\/p>\n<p>1. Open featured-category.php in functions &gt; theme &gt; widgets &gt; featured-category.php<\/p>\n<p>2. Replace all code between &lt;?php and ?&gt; in featured-category.php with following code<\/p>\n<pre class=\"brush: php; title: Code Block; notranslate\" title=\"Code Block\">\r\n\r\n\/*------------------------------------------*\/\r\n\/* WPZOOM: Featured Category widget *\/\r\n\/*------------------------------------------*\/\r\n$wpzoomColors = array();\r\n$wpzoomColors&#x5B;'blue'] = 'Blue';\r\n$wpzoomColors&#x5B;'red'] = 'Red';\r\n$wpzoomColors&#x5B;'black'] = 'Black';\r\nclass wpzoom_widget_category extends WP_Widget {\r\n\r\n\/* Widget setup. *\/\r\n function wpzoom_widget_category() {\r\n \/* Widget settings. *\/\r\n $widget_ops = array( 'classname' =&gt; 'wpzoom', 'description' =&gt; __('Featured Category Widget for Homepage', 'wpzoom') );\r\n\r\n\/* Widget control settings. *\/\r\n $control_ops = array( 'width' =&gt; 250, 'height' =&gt; 350, 'id_base' =&gt; 'wpzoom-widget-cat' );\r\n\r\n\/* Create the widget. *\/\r\n $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\n function widget( $args, $instance ) {\r\n extract( $args );\r\n\r\n\/* Our variables from the widget settings. *\/\r\n $title1 = apply_filters('widget_title', $instance&#x5B;'title1'] );\r\n $color1 = $instance&#x5B;'color1'];\r\n $posts1 = $instance&#x5B;'posts1'];\r\n $show_thumb = $instance&#x5B;'show_thumb'] ? true : false;\r\n $category1 = get_category($instance&#x5B;'category1']);\r\n if ($category1) {\r\n $categoryLink1 = get_category_link($category1);\r\n }\r\n\r\n\/* Before widget (defined by themes). *\/\r\n \/\/echo $before_widget;\r\n\r\n$z = 0;\r\n while ($z &lt; 1)\r\n {\r\n $z++;\r\n\r\n$color = &quot;color$z&quot;;\r\n $categoryLink = &quot;categoryLink$z&quot;;\r\n $title = &quot;title$z&quot;;\r\n $posts = &quot;posts$z&quot;;\r\n $category = $instance&#x5B;&quot;category$z&quot;];\r\n?&gt;\r\n &lt;?php\r\n\r\necho '&lt;div class=&quot;homecat '.$$color.'&quot;&gt;';\r\n\r\nif ( $$title ) { echo '&lt;h4&gt;&lt;a href=&quot;'.$$categoryLink.'&quot;&gt;'.$$title.'&lt;\/a&gt;&lt;\/h4&gt;'; } ?&gt;\r\n\r\n&lt;ul&gt;\r\n\r\n&lt;?php\r\n $second_query = new WP_Query( array( 'cat' =&gt; $category, 'showposts' =&gt; $$posts, 'orderby' =&gt; 'date', 'order' =&gt; 'DESC' ) );\r\n\r\n$i = 0;\r\n if ( $second_query-&gt;have_posts() ) : while( $second_query-&gt;have_posts() ) : $second_query-&gt;the_post();\r\n unset($image,$cropLocation);\r\n $i++;\r\n global $post;\r\n\r\n?&gt;\r\n &lt;li&gt;\r\n\r\n&lt;div class=&quot;thumb&quot;&gt;\r\n\r\n&lt;?php\r\n\r\n$permalink = get_permalink();\r\n $comments = get_comments_number();\r\n $comment_write = '&lt;span class=&quot;meta&quot;&gt;'.get_the_date().'&lt;strong&gt;'.$comments.'&lt;\/strong&gt;&lt;\/span&gt;';\r\n\r\nif ( $show_thumb ) {\r\n\r\n get_the_image( array( 'size' =&gt; 'featured-cat', 'width' =&gt; 200, 'height' =&gt; 125, 'before' =&gt; '&lt;a href=&quot;'.$permalink.'&quot;&gt;', 'after' =&gt; $comment_write.'&lt;\/a&gt;', 'link_to_post' =&gt; false ) );\r\n\r\n}\r\n ?&gt;\r\n\r\n&lt;\/div&gt;\r\n\r\n&lt;h3&gt;&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;&lt;\/h3&gt;\r\n\r\n&lt;p&gt;&lt;?php the_content_limit(95); ?&gt;&lt;\/p&gt;\r\n\r\n&lt;\/li&gt;\r\n &lt;?php endwhile; ?&gt;\r\n &lt;?php endif; ?&gt;\r\n\r\n&lt;\/ul&gt;\r\n &lt;ul class=&quot;stories&quot;&gt;\r\n\r\n&lt;?php\r\n $slidepost = new WP_Query( array( 'cat' =&gt; $category, 'showposts' =&gt; 3, 'offset' =&gt; $$posts, 'orderby' =&gt; 'date', 'order' =&gt; 'DESC' ) );\r\n\r\nwhile ( $slidepost-&gt;have_posts() ) {\r\n $slidepost-&gt;the_post();\r\n ?&gt;&lt;li&gt;&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;&lt;\/li&gt;&lt;?php\r\n }\r\n ?&gt;\r\n\r\n&lt;\/ul&gt;\r\n &lt;?php echo '&lt;a href=&quot;'.$$categoryLink.'&quot; class=&quot;nextActions&quot;&gt;'; _e('More in this category &amp;rarr;', 'wpzoom'); echo '&lt;\/a&gt;'; ?&gt;\r\n &lt;\/div&gt;\r\n\r\n&lt;?php\r\n\r\n} \/\/ while\r\n echo ' &lt;!-- end .featCategory --&gt;';\r\n \/* After widget (defined by themes). *\/\r\n \/\/echo $after_widget;\r\n wp_reset_query();\r\n }\r\n\r\n\/* Update the widget settings.*\/\r\n function update( $new_instance, $old_instance ) {\r\n $instance = $old_instance;\r\n\r\n\/* Strip tags for title and name to remove HTML (important for text inputs). *\/\r\n $instance&#x5B;'title1'] = strip_tags( $new_instance&#x5B;'title1'] );\r\n $instance&#x5B;'category1'] = $new_instance&#x5B;'category1'];\r\n $instance&#x5B;'color1'] = $new_instance&#x5B;'color1'];\r\n $instance&#x5B;'posts1'] = $new_instance&#x5B;'posts1'];\r\n $instance&#x5B;'show_thumb'] = $new_instance&#x5B;'show_thumb'];\r\n\r\nreturn $instance;\r\n }\r\n\r\n\/** Displays the widget settings controls on the widget panel.\r\n * Make use of the get_field_id() and get_field_name() function when creating your form elements. This handles the confusing stuff. *\/\r\n function form( $instance ) {\r\n\r\n\/* Set up some default widget settings. *\/\r\n $defaults = array( 'title1' =&gt; __('Category Name', 'wpzoom'), 'category1' =&gt; '0', 'color1' =&gt; 'blue', 'posts1' =&gt; '3' );\r\n $instance = wp_parse_args( (array) $instance, $defaults );\r\n global $wpzoomColors;\r\n ?&gt;\r\n\r\n&lt;p&gt;\r\n &lt;label for=&quot;&lt;?php echo $this-&gt;get_field_id( 'title1' ); ?&gt;&quot;&gt;&lt;?php _e('Category Title:', 'wpzoom'); ?&gt;&lt;\/label&gt;\r\n &lt;input type=&quot;text&quot; 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; \/&gt;\r\n &lt;\/p&gt;\r\n\r\n&lt;p&gt;\r\n &lt;label for=&quot;&lt;?php echo $this-&gt;get_field_id('color1'); ?&gt;&quot;&gt;&lt;?php _e('Title Background Color:', 'wpzoom'); ?&gt;&lt;\/label&gt;\r\n &lt;select id=&quot;&lt;?php echo $this-&gt;get_field_id('color1'); ?&gt;&quot; name=&quot;&lt;?php echo $this-&gt;get_field_name('color1'); ?&gt;&quot; style=&quot;width:90%;&quot;&gt;\r\n &lt;?php\r\n foreach ($wpzoomColors as $key =&gt; $value) {\r\n $option = '&lt;option value=&quot;'.$key;\r\n if ($key == $instance&#x5B;'color1']) { $option .='&quot; selected=&quot;selected';}\r\n $option .= '&quot;&gt;';\r\n $option .= $value;\r\n $option .= '&lt;\/option&gt;';\r\n echo $option;\r\n }\r\n ?&gt;\r\n &lt;\/select&gt;\r\n &lt;\/p&gt;\r\n\r\n&lt;p&gt;\r\n &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 &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 &lt;option value=&quot;0&quot;&gt;Choose category:&lt;\/option&gt;\r\n &lt;?php\r\n $cats = get_categories('hide_empty=0');\r\n\r\nforeach ($cats as $cat) {\r\n $option = '&lt;option value=&quot;'.$cat-&gt;term_id;\r\n if ($cat-&gt;term_id == $instance&#x5B;'category1']) { $option .='&quot; selected=&quot;selected';}\r\n $option .= '&quot;&gt;';\r\n $option .= $cat-&gt;cat_name;\r\n $option .= ' ('.$cat-&gt;category_count.')';\r\n $option .= '&lt;\/option&gt;';\r\n echo $option;\r\n }\r\n ?&gt;\r\n &lt;\/select&gt;\r\n &lt;\/p&gt;\r\n\r\n&lt;p&gt;\r\n &lt;label for=&quot;&lt;?php echo $this-&gt;get_field_id('posts1'); ?&gt;&quot;&gt;&lt;?php _e('Posts to show:', 'wpzoom'); ?&gt;&lt;\/label&gt;\r\n &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 &lt;?php\r\n $m = 0;\r\n while ($m &lt; 11) {\r\n $m++;\r\n $option = '&lt;option value=&quot;'.$m;\r\n if ($m == $instance&#x5B;'posts1']) { $option .='&quot; selected=&quot;selected';}\r\n $option .= '&quot;&gt;';\r\n $option .= $m;\r\n $option .= '&lt;\/option&gt;';\r\n echo $option;\r\n }\r\n ?&gt;\r\n &lt;\/select&gt;\r\n &lt;\/p&gt;\r\n &lt;p&gt;\r\n &lt;input class=&quot;checkbox&quot; type=&quot;checkbox&quot; &lt;?php checked( $instance&#x5B;'show_thumb'], 'on' ); ?&gt; id=&quot;&lt;?php echo $this-&gt;get_field_id( 'show_thumb' ); ?&gt;&quot; name=&quot;&lt;?php echo $this-&gt;get_field_name( 'show_thumb' ); ?&gt;&quot; \/&gt;\r\n &lt;label for=&quot;&lt;?php echo $this-&gt;get_field_id( 'show_thumb' ); ?&gt;&quot;&gt;Display post thumbnail&lt;\/label&gt;\r\n &lt;\/p&gt;\r\n\r\n&lt;?php\r\n }\r\n}\r\n\r\nfunction wpzoom_register_category_widget() {\r\n register_widget('wpzoom_widget_category');\r\n}\r\nadd_action('widgets_init', 'wpzoom_register_category_widget');\r\n<\/pre>\n<p>3. Select\/Deselect Display Post Thumbnail on the widget<br \/>\n4. Done<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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 &#8211; World &#8211; Sports &#8211; Automotive). The widget show thumbnails by default, it doesn&#8217;t have feature to disable that. What if you want [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":287,"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":[55,6,95],"class_list":["post-284","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-code-snippet","category-wordpress","tag-code-snippet-2","tag-wordpress-2","tag-wpzoom"],"aioseo_notices":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/pixert.com\/blog\/wp-content\/uploads\/2013\/02\/WPZOOMFeaturedCategory.jpg?fit=307%2C470&ssl=1","jetpack_shortlink":"https:\/\/wp.me\/p1pvi1-4A","jetpack-related-posts":[{"id":218,"url":"https:\/\/pixert.com\/blog\/how-to-fix-custom-field-for-thumbnails-wpzoom-featured-category-widget\/","url_meta":{"origin":284,"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":256,"url":"https:\/\/pixert.com\/blog\/exclude-featured-posts-from-wpzoom-featured-category-widget\/","url_meta":{"origin":284,"position":1},"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":222,"url":"https:\/\/pixert.com\/blog\/wpzoom-featured-category-widget-videozoom\/","url_meta":{"origin":284,"position":2},"title":"WPZoom Featured Category Widget with video for Videozoom theme","author":"Pixel Insert \/ Pixert","date":"April 6, 2012","format":false,"excerpt":"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 [php] \/*---------------------------------------------*\/ \/* WPZOOM: Featured Category widget with Video\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":546,"url":"https:\/\/pixert.com\/blog\/the-importance-of-child-theme-in-wordpress\/","url_meta":{"origin":284,"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":130,"url":"https:\/\/pixert.com\/blog\/enable-formatting-tags-for-content-limit-in-genesis-featured-posts-widget\/","url_meta":{"origin":284,"position":4},"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":[]},{"id":305,"url":"https:\/\/pixert.com\/blog\/wordpress-conditional-tag-to-check-specific-menu\/","url_meta":{"origin":284,"position":5},"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":[]}],"jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/pixert.com\/blog\/wp-json\/wp\/v2\/posts\/284","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=284"}],"version-history":[{"count":0,"href":"https:\/\/pixert.com\/blog\/wp-json\/wp\/v2\/posts\/284\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/pixert.com\/blog\/wp-json\/wp\/v2\/media\/287"}],"wp:attachment":[{"href":"https:\/\/pixert.com\/blog\/wp-json\/wp\/v2\/media?parent=284"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pixert.com\/blog\/wp-json\/wp\/v2\/categories?post=284"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pixert.com\/blog\/wp-json\/wp\/v2\/tags?post=284"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}