{"id":1157,"date":"2016-03-15T00:16:39","date_gmt":"2016-03-14T23:16:39","guid":{"rendered":"http:\/\/monodes.com\/predaelli\/?p=1157"},"modified":"2016-03-18T19:22:26","modified_gmt":"2016-03-18T18:22:26","slug":"all-in-one-show-events-as-regular-posts-cerca-con-google","status":"publish","type":"post","link":"https:\/\/monodes.com\/predaelli\/2016\/03\/15\/all-in-one-show-events-as-regular-posts-cerca-con-google\/","title":{"rendered":"&#8220;all in one&#8221; show events as regular posts &#8211; Cerca con Google"},"content":{"rendered":"<p>The one thing I really liked in &#8220;<a href=\"https:\/\/wordpress.org\/plugins\/the-events-calendar\/\">The Events Calendar<\/a>&#8221; from<a href=\"https:\/\/profiles.wordpress.org\/moderntribe\/\"> Modern Tribe, Inc.<\/a> is its ability to show its events in the flow of WordPress posts. Sadly its calendars cannot sync so people can&#8217;t just say &#8220;let&#8217;s subscribe to this nice calendar and see all those events in my calendar on my smartphone or at home&#8221;.<\/p>\n<p><a dir=\"ltr\" href=\"https:\/\/wordpress.org\/plugins\/all-in-one-event-calendar\/\" target=\"_top\" data-ctorig=\"https:\/\/wordpress.org\/plugins\/all-in-one-event-calendar\/\" data-cturl=\"https:\/\/www.google.com\/url?q=https:\/\/wordpress.org\/plugins\/all-in-one-event-calendar\/&amp;sa=U&amp;ved=0ahUKEwip14z7o8HLAhWoYZoKHS7pA8oQFggEMAA&amp;client=internal-uds-cse&amp;usg=AFQjCNFUbuadmHaD8PkFjseFrMbxBNRmTw\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/monodes.com\/predaelli\/wp-content\/uploads\/sites\/4\/2016\/03\/featured-image-510x175.png?resize=510%2C175\" alt=\"[cml_media_alt id='1155']All in one event calendar[\/cml_media_alt]\" width=\"510\" height=\"175\" \/>All-in-One Event Calendar <\/a>on the contrary has everything I need for the forthcoming website of my parish &#8220;SS. Siro and Materno&#8221; in Desio. There is one thing it lacks that I find quite useful: the ability to show its events in the flow of WordPress posts.<\/p>\n<p><!--more--><\/p>\n<p><a href=\"https:\/\/www.google.it\/search?client=ubuntu&amp;channel=fs&amp;q=all+in+one+event+calendar+integrate+events+into+wordpress&amp;ie=utf-8&amp;oe=utf-8&amp;gfe_rd=cr&amp;ei=hdfmVpTJGIaBaO34lYgI#channel=fs&amp;q=%22all+in+one%22+show+events+as+regular+posts\">As usual Google is your frient and searching for \u00ab&#8221;all in one&#8221; show events as regular posts\u00bb <\/a>gave me quite some hints:<\/p>\n<ul>\n<li><a href=\"https:\/\/wordpress.org\/support\/topic\/plugin-all-in-one-event-calendar-show-event-with-posts-and-include-in-rss\">https:\/\/wordpress.org\/support\/topic\/plugin-all-in-one-event-calendar-show-event-with-posts-and-include-in-rss<\/a><\/li>\n<li><a href=\"http:\/\/wp.miragearts.com\/allinone-event-calendar-events-blog-home-categories-tags\/\">http:\/\/wp.miragearts.com\/allinone-event-calendar-events-blog-home-categories-tags\/<\/a><\/li>\n<li><a href=\"https:\/\/wordpress.org\/support\/topic\/plugin-all-in-one-event-calendar-page-with-events-and-posts\">https:\/\/wordpress.org\/support\/topic\/plugin-all-in-one-event-calendar-page-with-events-and-posts<\/a><\/li>\n<li><a href=\"http:\/\/justintadlock.com\/archives\/2010\/02\/02\/showing-custom-post-types-on-your-home-blog-page\">http:\/\/justintadlock.com\/archives\/2010\/02\/02\/showing-custom-post-types-on-your-home-blog-page<\/a><br \/>\nThis one is the page I looked for!<\/li>\n<\/ul>\n<p>WordPress in this case demonstrates the infinite ductility of interpreted scripting languages like PHP.<\/p>\n<p>All I had to do is to add this function in the PHP functions.php file:<\/p>\n<pre lang=\"php\">add_filter( 'pre_get_posts', 'my_get_posts' );\n\nfunction my_get_posts( $query ) {\n\n    if ( is_home() &amp;&amp; $query-&gt;is_main_query() )\n        $query-&gt;set( 'post_type', array( 'post', 'ai1ec_event' ) );\n\n    return $query;\n}<\/pre>\n<p>In fact &#8220;All in one event calendar&#8221; create a new custom post type name ai1ec_event.<\/p>\n<p>Now all I got to do is to find a nice magazine-like theme that fits the needs of my parish and looks sleek and shiny. You can&#8217;t believe how long it takes to find a satisfactory theme.<\/p>\n<p><!--nextpage--><\/p>\n<blockquote>\n<h2>Showing custom post types on your home\/blog page<\/h2>\n<div>Published by <a title=\"Justin Tadlock\" href=\"http:\/\/justintadlock.com\/about\" rel=\"author\">Justin Tadlock<\/a> on <time title=\"Tuesday, February 2nd, 2010, 3:22 am\" datetime=\"2010-02-02T03:22:47+00:00\">February 2, 2010<\/time> | <a title=\"Comment on Showing custom post types on your home\/blog page\" href=\"http:\/\/justintadlock.com\/archives\/2010\/02\/02\/showing-custom-post-types-on-your-home-blog-page#comments\">192 Responses<\/a><\/div>\n<div>\n<p>In the last few days, I\u2019ve shown a few people a <a title=\"Justin Tadlock future home page\" href=\"http:\/\/justintadlock.com\/blog\/wp-content\/uploads\/2010\/02\/justin-tadlock-future.png\">screenshot<\/a> of something I\u2019ve been working on for this site. The screenshot is of a home page displaying custom post types and not just the post post type. After numerous requests for the code to do this, I figured it\u2019d be much easier to share it here.<\/p>\n<p>WordPress version 3.0 will make creating <a title=\"WordPress Trac: Better support for custom post types\" href=\"http:\/\/core.trac.wordpress.org\/ticket\/9674\">custom post types<\/a> extremely simple. But, the techniques I\u2019ll point out in this tutorial can be used with previous versions of WordPress.<\/p>\n<h2>Changing the post type on the home page<\/h2>\n<p>By default, WordPress shows the post post type on your home page. Let\u2019s suppose we want to show several post types in addition to posts:<\/p>\n<ul>\n<li>page (yes, regular pages)<\/li>\n<li>album<\/li>\n<li>movie<\/li>\n<li>quote<\/li>\n<\/ul>\n<p>To add these, open your theme\u2019s functions.php file and paste this <acronym title=\"Hypertext Preprocessor\">PHP<\/acronym> code into it:<\/p>\n<pre>add_filter( 'pre_get_posts', 'my_get_posts' );\n\nfunction my_get_posts( $query ) {\n\n    if ( is_home() &amp;&amp; $query-&gt;is_main_query() )\n        $query-&gt;set( 'post_type', array( 'post', 'page', 'album', 'movie', 'quote' ) );\n\n    return $query;\n}<\/pre>\n<p>That\u2019s all there is to it.<\/p>\n<h2>Showing the post types in your feed<\/h2>\n<p>Realizing that many of you might want to also add these post types to your feed to match your blog, a small change in the code is required. All you need to do is change this line:<\/p>\n<pre>if ( is_home() &amp;&amp; $query-&gt;is_main_query() )<\/pre>\n<p>We\u2019ll use the is_feed() conditional tag:<\/p>\n<pre>if ( ( is_home() &amp;&amp; $query-&gt;is_main_query() ) || is_feed() )<\/pre>\n<p>Now, you can have custom post types in your regular blog post rotation and your feed. Enjoy and look for more custom post type tutorials soon.<\/p>\n<\/div>\n<\/blockquote>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p class=\"excerpt\">The one thing I really liked in &#8220;The Events Calendar&#8221; from Modern Tribe, Inc. is its ability to show its events in the flow of WordPress posts. Sadly its calendars cannot sync so people can&#8217;t just say &#8220;let&#8217;s subscribe to this nice calendar and see all those events in my calendar on my smartphone or&hellip;<\/p>\n<p class=\"more-link-p\"><a class=\"more-link\" href=\"https:\/\/monodes.com\/predaelli\/2016\/03\/15\/all-in-one-show-events-as-regular-posts-cerca-con-google\/\">Read more &rarr;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"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,"activitypub_content_warning":"","activitypub_content_visibility":"","activitypub_max_image_attachments":4,"activitypub_interaction_policy_quote":"anyone","activitypub_status":"","footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[19],"tags":[],"class_list":["post-1157","post","type-post","status-publish","format-standard","hentry","category-mood"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p6daft-iF","jetpack-related-posts":[{"id":1154,"url":"https:\/\/monodes.com\/predaelli\/2016\/03\/14\/all-in-one-events-calendar-or-the-events-calendar\/","url_meta":{"origin":1157,"position":0},"title":"All in One Events Calendar OR The Events Calendar ?","author":"Paolo Redaelli","date":"2016-03-14","format":false,"excerpt":"All in One Events Calendar OR The Events Calendar ? What is the best events calendar plugin for Wordpress? This is a review of the All in One Events Calendar and The Events Calendar I'm precisely in his situation for the website of my parish! All in One has almost\u2026","rel":"","context":"In &quot;Mood&quot;","block_context":{"text":"Mood","link":"https:\/\/monodes.com\/predaelli\/category\/mood\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":3803,"url":"https:\/\/monodes.com\/predaelli\/2018\/02\/15\/changing-the-domain-name-on-wordpress-multi-site\/","url_meta":{"origin":1157,"position":1},"title":"Changing the Domain Name on WordPress Multi-site","author":"Paolo Redaelli","date":"2018-02-15","format":false,"excerpt":"At work I've set up a little WordPress network to record workflow notes. One blog for quality management, one used by person in charge of the concrete plant - I do mildly dislike the word \"manager\" as it is wildly misused here in Italy - and another for the administrative\u2026","rel":"","context":"In &quot;Wordpress&quot;","block_context":{"text":"Wordpress","link":"https:\/\/monodes.com\/predaelli\/category\/wordpress\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":11117,"url":"https:\/\/monodes.com\/predaelli\/2024\/01\/07\/htmhell-advent-calendar-2023-htmhell\/","url_meta":{"origin":1157,"position":2},"title":"HTMHell Advent Calendar 2023 &#8211; HTMHell","author":"Paolo Redaelli","date":"2024-01-07","format":false,"excerpt":"An article, talk, or tool that focuses on HTML every day until Christmas. Source: HTMHell Advent Calendar 2023 - HTMHell","rel":"","context":"In &quot;Web&quot;","block_context":{"text":"Web","link":"https:\/\/monodes.com\/predaelli\/category\/web\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":4985,"url":"https:\/\/monodes.com\/predaelli\/2018\/12\/03\/own-your-data-part-iii-moving-calendar-and-contacts-into-my-owncloud-sebastian-greger\/","url_meta":{"origin":1157,"position":3},"title":"\u201cOwn your data\u201d, part III: Moving calendar and contacts into my ownCloud \/\/ Sebastian Greger","author":"Paolo Redaelli","date":"2018-12-03","format":false,"excerpt":"https:\/\/sebastiangreger.net\/2014\/03\/own-your-data-part-3-calendar-contacts-owncloud\/ Tonight assignment","rel":"","context":"In &quot;Ethics&quot;","block_context":{"text":"Ethics","link":"https:\/\/monodes.com\/predaelli\/category\/ethics\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":14852,"url":"https:\/\/monodes.com\/predaelli\/2026\/01\/28\/give-them-even-that-data\/","url_meta":{"origin":1157,"position":4},"title":"Give them even that data!","author":"Paolo Redaelli","date":"2026-01-28","format":false,"excerpt":"Gemini In Google Calendar Now Helps You Find the Best Meeting Time For All Attendees Fine, give an \"uncontrollable\" AI complete access to your calendar. Give them even that data! What could possibly go wrong? William Gibson already foresaw it: in his books all military grade AI must be kept\u2026","rel":"","context":"In &quot;Ethics&quot;","block_context":{"text":"Ethics","link":"https:\/\/monodes.com\/predaelli\/category\/ethics\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/monodes.com\/predaelli\/wp-content\/uploads\/sites\/4\/2026\/01\/terminator.webp?fit=201%2C251&ssl=1&resize=350%2C200","width":350,"height":200},"classes":[]},{"id":3451,"url":"https:\/\/monodes.com\/predaelli\/2017\/10\/23\/dovecotowncloud\/","url_meta":{"origin":1157,"position":5},"title":"Dovecot+ownCloud","author":"Paolo Redaelli","date":"2017-10-23","format":false,"excerpt":"As a followup to my article\u00a0Replicating IMAPs (dovecot) mails folders and sharing (through ownCloud) contacts (kmail, roundcube, etc),\u00a0 I\u2019d like to point out that, these days, I almost comple\u2026 Sorgente: Checking mails\/addressbook\/calendars with IMAPS (Dovecot) + DAV (ownCloud) \u2013 # cd \/scratch Ok that's exactly what my office need","rel":"","context":"In &quot;Senza categoria&quot;","block_context":{"text":"Senza categoria","link":"https:\/\/monodes.com\/predaelli\/category\/senza-categoria\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/posts\/1157","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/comments?post=1157"}],"version-history":[{"count":0,"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/posts\/1157\/revisions"}],"wp:attachment":[{"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/media?parent=1157"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/categories?post=1157"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/tags?post=1157"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}