28
Widget Visibility and Other Secret Loves

Widget Visibility and other Secret Loves - WordCamp Ottawa 2016

Embed Size (px)

Citation preview

Page 1: Widget Visibility and other Secret Loves - WordCamp Ottawa 2016

Widget Visibility and Other Secret Loves

Page 2: Widget Visibility and other Secret Loves - WordCamp Ottawa 2016

@richardmtl

Happiness Engineer with Automattic

[email protected]

Richard Archambault

Montrealer, fan of metros (and Mini Metro!)

wpmtl.org

Page 3: Widget Visibility and other Secret Loves - WordCamp Ottawa 2016

Mini Metro!

dinopoloclub.com/minimetro/

Page 4: Widget Visibility and other Secret Loves - WordCamp Ottawa 2016
Page 5: Widget Visibility and other Secret Loves - WordCamp Ottawa 2016

Useful Modules

Page 6: Widget Visibility and other Secret Loves - WordCamp Ottawa 2016

Custom CSS

Page 7: Widget Visibility and other Secret Loves - WordCamp Ottawa 2016

Widget Visibility

Page 8: Widget Visibility and other Secret Loves - WordCamp Ottawa 2016

Extra Sidebar Widgets

Image GoodreadsContact Info

Page 9: Widget Visibility and other Secret Loves - WordCamp Ottawa 2016

Shortcode Embeds

Soundcloud SlideshareRecipes

Page 10: Widget Visibility and other Secret Loves - WordCamp Ottawa 2016

Protect

Page 11: Widget Visibility and other Secret Loves - WordCamp Ottawa 2016

Site Verification Tools

Page 12: Widget Visibility and other Secret Loves - WordCamp Ottawa 2016

Theme Tools

Page 13: Widget Visibility and other Secret Loves - WordCamp Ottawa 2016

Social Icons Widget Social Menu

• Facebook • Twitter • Instagram • Pinterest • LinkedIN • Github • YouTube • Vimeo • Google+

• CodePen • Digg • Dribble • Dropbox • Email • Facebook • Flickr • Foursquare • Github • Google+ • Instagram • LinkedIn • Path • Pinterest

• Pocket • Polldaddy • Reddit • RSS feed • Skype • Spotify • StumbleUpon • Tumblr • Twitch • Twitter • Vimeo • WordPress • Youtube

Social LinksWidgets

• Facebook • Twitter • LinkedIn • Google+ • Tumblr

Publicize connections Custom Menu

Let’s get Social!

Page 14: Widget Visibility and other Secret Loves - WordCamp Ottawa 2016

Social Menuadd_theme_support('jetpack-social-menu');

<?phpif(function_exists('jetpack_social_menu'))jetpack_social_menu();?>

https://jetpack.com/support/social-menu/

Page 15: Widget Visibility and other Secret Loves - WordCamp Ottawa 2016

Responsive Videofunctionjetpackme_responsive_videos_setup(){add_theme_support('jetpack-responsive-videos');}add_action('after_setup_theme','jetpackme_responsive_videos_setup');

https://jetpack.com/support/responsive-videos/

Page 16: Widget Visibility and other Secret Loves - WordCamp Ottawa 2016

Breadcrumbsif(function_exists('jetpack_breadcrumbs')):?><divclass="my-breadcrumbs"><?phpjetpack_breadcrumbs();?></div><!--.my-breadcrumbs--><?phpendif;?>

Page 17: Widget Visibility and other Secret Loves - WordCamp Ottawa 2016

Other Theme Tools

•Tonesque (colours!) •Infinite Scroll •Featured Content

Page 18: Widget Visibility and other Secret Loves - WordCamp Ottawa 2016

Useful Filters

Page 19: Widget Visibility and other Secret Loves - WordCamp Ottawa 2016

Open Graph

functionjetpackme_developer_fb_home_image($tags){if(is_home()||is_front_page()){//RemovethedefaultblankimageaddedbyJetpackunset($tags['og:image']);$fb_home_img='YOUR_IMAGE_URL';$tags['og:image']=esc_url($fb_home_img);}return$tags;}add_filter('jetpack_open_graph_tags','jetpackme_developer_fb_home_image');

Custom tag for the home page

https://jetpack.com/2013/07/12/add-a-default-image-open-graph-tag-on-home-page/

Page 20: Widget Visibility and other Secret Loves - WordCamp Ottawa 2016

Open Graphfunctionjetpackdeveloper_custom_image($media,$post_id,$args){if($media){return$media;}else{$permalink=get_permalink($post_id);$url=apply_filters('jetpack_photon_url','YOUR_LOGO_IMG_URL');returnarray(array('type'=>'image','from'=>'custom_fallback','src'=>esc_url($url),'href'=>$permalink,));}}add_filter('jetpack_images_get_images','jetpackdeveloper_custom_image',10,3);

Add fallback default image

https://jetpack.com/2013/10/15/add-a-default-fallback-image-if-no-image/

Page 21: Widget Visibility and other Secret Loves - WordCamp Ottawa 2016

Subscriptions

functionjetpackme_exclude_posts_subscriptions($categories){$categories=array('boring','dull');return$categories;}add_filter('jetpack_subscriptions_exclude_these_categories','jetpackme_exclude_posts_subscriptions');

Exclude categories of posts

Page 22: Widget Visibility and other Secret Loves - WordCamp Ottawa 2016

Related Posts

functionjetpackme_more_related_posts($options){$options['size']=6;return$options;}add_filter('jetpack_relatedposts_filter_options','jetpackme_more_related_posts');

Change the number of posts displayed

https://jetpack.com/support/related-posts/customize-related-posts/

Page 23: Widget Visibility and other Secret Loves - WordCamp Ottawa 2016

Related Posts

functionallow_my_post_types($allowed_post_types){$allowed_post_types[]='your-post-type';return$allowed_post_types;}add_filter('rest_api_allowed_post_types','allow_my_post_types');

Include Custom Post Types

https://jetpack.com/support/related-posts/customize-related-posts/

Page 24: Widget Visibility and other Secret Loves - WordCamp Ottawa 2016

Need help?

jetpack.com/support

@jetpack

Page 25: Widget Visibility and other Secret Loves - WordCamp Ottawa 2016

Lots more!

https://jetpack.com/tag/hook-of-the-month/

Page 26: Widget Visibility and other Secret Loves - WordCamp Ottawa 2016

https://developer.jetpack.com/

Brand New!

Page 27: Widget Visibility and other Secret Loves - WordCamp Ottawa 2016
Page 28: Widget Visibility and other Secret Loves - WordCamp Ottawa 2016

@[email protected]

Questions?