{"id":7109342,"date":"2016-02-25T22:05:00","date_gmt":"2016-02-25T22:05:00","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/subcripter-allow_per_post_subscriptions\/"},"modified":"2016-08-31T13:56:44","modified_gmt":"2016-08-31T13:56:44","slug":"subcripter-allow_per_post_subscriptions","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/subcripter-allow_per_post_subscriptions\/","title":{"rendered":"subcripter allow_per_post_subscriptions"},"content":{"rendered":"<p>Hello,<\/p>\n<p>I want to ad an option to send on subcripter only some post so i found this<br \/>\n<a href=\"https:\/\/jetpack.me\/support\/subscriptions\/\">https:\/\/jetpack.me\/support\/subscriptions\/<\/a><\/p>\n<p>they say to add this code<\/p>\n<p>php<br \/>\nadd_filter( &#8216;jetpack_allow_per_post_subscriptions&#8217;, &#8216;__return_true&#8217; );<\/p>\n<p>in function.php but always I get the white dead screen , My theme is twenty eleven and my function.php is the code that you can see.<br \/>\nCan someone help me to make it exactly? because when I add this line<br \/>\nphp<br \/>\nadd_filter( &#8216;jetpack_allow_per_post_subscriptions&#8217;, &#8216;__return_true&#8217; );<\/p>\n<p>I probably do something wrong but what?<br \/>\nthank you in advance<\/p>\n<pre><code>&lt;?php\n\/**\n * Twenty Eleven functions and definitions\n *\n * Sets up the theme and provides some helper functions. Some helper functions\n * are used in the theme as custom template tags. Others are attached to action and\n * filter hooks in WordPress to change core functionality.\n *\n * The first function, twentyeleven_setup(), sets up the theme by registering support\n * for various features in WordPress, such as post thumbnails, navigation menus, and the like.\n *\n * When using a child theme (see https:\/\/codex.wordpress.org\/Theme_Development and\n * https:\/\/codex.wordpress.org\/Child_Themes), you can override certain functions\n * (those wrapped in a function_exists() call) by defining them first in your child theme&#039;s\n * functions.php file. The child theme&#039;s functions.php file is included before the parent\n * theme&#039;s file, so the child theme functions would be used.\n *\n * Functions that are not pluggable (not wrapped in function_exists()) are instead attached\n * to a filter or action hook. The hook can be removed by using remove_action() or\n * remove_filter() and you can attach your own function to the hook.\n *\n * We can remove the parent theme&#039;s hook only after it is attached, which means we need to\n * wait until setting up the child theme:\n *\n * &lt;code&gt;\n * add_action( &#039;after_setup_theme&#039;, &#039;my_child_theme_setup&#039; );\n * function my_child_theme_setup() {\n *     \/\/ We are providing our own filter for excerpt_length (or using the unfiltered value)\n *     remove_filter( &#039;excerpt_length&#039;, &#039;twentyeleven_excerpt_length&#039; );\n *     ...\n * }\n * &lt;\/code&gt;\n *\n * For more information on hooks, actions, and filters, see https:\/\/codex.wordpress.org\/Plugin_API.\n *\n * @package WordPress\n * @subpackage Twenty_Eleven\n * @since Twenty Eleven 1.0\n *\/\n\n\/\/ Set the content width based on the theme&#039;s design and stylesheet.\nif ( ! isset( $content_width ) )\n\t$content_width = 584;\n\n\/*\n * Tell WordPress to run twentyeleven_setup() when the &#039;after_setup_theme&#039; hook is run.\n *\/\nadd_action( &#039;after_setup_theme&#039;, &#039;twentyeleven_setup&#039; );\n\nif ( ! function_exists( &#039;twentyeleven_setup&#039; ) ):\n\/**\n * Set up theme defaults and registers support for various WordPress features.\n *\n * Note that this function is hooked into the after_setup_theme hook, which runs\n * before the init hook. The init hook is too late for some features, such as indicating\n * support post thumbnails.\n *\n * To override twentyeleven_setup() in a child theme, add your own twentyeleven_setup to your child theme&#039;s\n * functions.php file.\n *\n * @uses load_theme_textdomain()    For translation\/localization support.\n * @uses add_editor_style()         To style the visual editor.\n * @uses add_theme_support()        To add support for post thumbnails, automatic feed links, custom headers\n * \t                                and backgrounds, and post formats.\n * @uses register_nav_menus()       To add support for navigation menus.\n * @uses register_default_headers() To register the default custom header images provided with the theme.\n * @uses set_post_thumbnail_size()  To set a custom post thumbnail size.\n *\n * @since Twenty Eleven 1.0\n *\/\nfunction twentyeleven_setup() {\n\n\t\/*\n\t * Make Twenty Eleven available for translation.\n\t * Translations can be added to the \/languages\/ directory.\n\t * If you&#039;re building a theme based on Twenty Eleven, use\n\t * a find and replace to change &#039;twentyeleven&#039; to the name\n\t * of your theme in all the template files.\n\t *\/\n\tload_theme_textdomain( &#039;twentyeleven&#039;, get_template_directory() . &#039;\/languages&#039; );\n\n\t\/\/ This theme styles the visual editor with editor-style.css to match the theme style.\n\tadd_editor_style();\n\n\t\/\/ Load up our theme options page and related code.\n\trequire( get_template_directory() . &#039;\/inc\/theme-options.php&#039; );\n\n\t\/\/ Grab Twenty Eleven&#039;s Ephemera widget.\n\trequire( get_template_directory() . &#039;\/inc\/widgets.php&#039; );\n\n\t\/\/ Add default posts and comments RSS feed links to &lt;head&gt;.\n\tadd_theme_support( &#039;automatic-feed-links&#039; );\n\n\t\/\/ This theme uses wp_nav_menu() in one location.\n\tregister_nav_menu( &#039;primary&#039;, __( &#039;Primary Menu&#039;, &#039;twentyeleven&#039; ) );\n\n\t\/\/ Add support for a variety of post formats\n\tadd_theme_support( &#039;post-formats&#039;, array( &#039;aside&#039;, &#039;link&#039;, &#039;gallery&#039;, &#039;status&#039;, &#039;quote&#039;, &#039;image&#039; ) );\n\n\t$theme_options = twentyeleven_get_theme_options();\n\tif ( &#039;dark&#039; == $theme_options[&#039;color_scheme&#039;] )\n\t\t$default_background_color = &#039;1d1d1d&#039;;\n\telse\n\t\t$default_background_color = &#039;e2e2e2&#039;;\n\n\t\/\/ Add support for custom backgrounds.\n\tadd_theme_support( &#039;custom-background&#039;, array(\n\t\t\/*\n\t\t * Let WordPress know what our default background color is.\n\t\t * This is dependent on our current color scheme.\n\t\t *\/\n\t\t&#039;default-color&#039; =&gt; $default_background_color,\n\t) );\n\n\t\/\/ This theme uses Featured Images (also known as post thumbnails) for per-post\/per-page Custom Header images\n\tadd_theme_support( &#039;post-thumbnails&#039; );\n\n\t\/\/ Add support for custom headers.\n\t$custom_header_support = array(\n\t\t\/\/ The default header text color.\n\t\t&#039;default-text-color&#039; =&gt; &#039;000&#039;,\n\t\t\/\/ The height and width of our custom header.\n\t\t\/**\n\t\t * Filter the Twenty Eleven default header image width.\n\t\t *\n\t\t * @since Twenty Eleven 1.0\n\t\t *\n\t\t * @param int The default header image width in pixels. Default 1000.\n\t\t *\/\n\t\t&#039;width&#039; =&gt; apply_filters( &#039;twentyeleven_header_image_width&#039;, 1000 ),\n\t\t\/**\n\t\t * Filter the Twenty Eleven default header image height.\n\t\t *\n\t\t * @since Twenty Eleven 1.0\n\t\t *\n\t\t * @param int The default header image height in pixels. Default 288.\n\t\t *\/\n\t\t&#039;height&#039; =&gt; apply_filters( &#039;twentyeleven_header_image_height&#039;, 288 ),\n\t\t\/\/ Support flexible heights.\n\t\t&#039;flex-height&#039; =&gt; true,\n\t\t\/\/ Random image rotation by default.\n\t\t&#039;random-default&#039; =&gt; true,\n\t\t\/\/ Callback for styling the header.\n\t\t&#039;wp-head-callback&#039; =&gt; &#039;twentyeleven_header_style&#039;,\n\t\t\/\/ Callback for styling the header preview in the admin.\n\t\t&#039;admin-head-callback&#039; =&gt; &#039;twentyeleven_admin_header_style&#039;,\n\t\t\/\/ Callback used to display the header preview in the admin.\n\t\t&#039;admin-preview-callback&#039; =&gt; &#039;twentyeleven_admin_header_image&#039;,\n\t);\n\n\tadd_theme_support( &#039;custom-header&#039;, $custom_header_support );\n\n\tif ( ! function_exists( &#039;get_custom_header&#039; ) ) {\n\t\t\/\/ This is all for compatibility with versions of WordPress prior to 3.4.\n\t\tdefine( &#039;HEADER_TEXTCOLOR&#039;, $custom_header_support[&#039;default-text-color&#039;] );\n\t\tdefine( &#039;HEADER_IMAGE&#039;, &#039;&#039; );\n\t\tdefine( &#039;HEADER_IMAGE_WIDTH&#039;, $custom_header_support[&#039;width&#039;] );\n\t\tdefine( &#039;HEADER_IMAGE_HEIGHT&#039;, $custom_header_support[&#039;height&#039;] );\n\t\tadd_custom_image_header( $custom_header_support[&#039;wp-head-callback&#039;], $custom_header_support[&#039;admin-head-callback&#039;], $custom_header_support[&#039;admin-preview-callback&#039;] );\n\t\tadd_custom_background();\n\t}\n\n\t\/*\n\t * We&#039;ll be using post thumbnails for custom header images on posts and pages.\n\t * We want them to be the size of the header image that we just defined.\n\t * Larger images will be auto-cropped to fit, smaller ones will be ignored. See header.php.\n\t *\/\n\tset_post_thumbnail_size( $custom_header_support[&#039;width&#039;], $custom_header_support[&#039;height&#039;], true );\n\n\t\/*\n\t * Add Twenty Eleven&#039;s custom image sizes.\n\t * Used for large feature (header) images.\n\t *\/\n\tadd_image_size( &#039;large-feature&#039;, $custom_header_support[&#039;width&#039;], $custom_header_support[&#039;height&#039;], true );\n\t\/\/ Used for featured posts if a large-feature doesn&#039;t exist.\n\tadd_image_size( &#039;small-feature&#039;, 500, 300 );\n\n\t\/\/ Default custom headers packaged with the theme. %s is a placeholder for the theme template directory URI.\n\tregister_default_headers( array(\n\t\t&#039;wheel&#039; =&gt; array(\n\t\t\t&#039;url&#039; =&gt; &#039;%s\/images\/headers\/wheel.jpg&#039;,\n\t\t\t&#039;thumbnail_url&#039; =&gt; &#039;%s\/images\/headers\/wheel-thumbnail.jpg&#039;,\n\t\t\t\/* translators: header image description *\/\n\t\t\t&#039;description&#039; =&gt; __( &#039;Wheel&#039;, &#039;twentyeleven&#039; )\n\t\t),\n\t\t&#039;shore&#039; =&gt; array(\n\t\t\t&#039;url&#039; =&gt; &#039;%s\/images\/headers\/shore.jpg&#039;,\n\t\t\t&#039;thumbnail_url&#039; =&gt; &#039;%s\/images\/headers\/shore-thumbnail.jpg&#039;,\n\t\t\t\/* translators: header image description *\/\n\t\t\t&#039;description&#039; =&gt; __( &#039;Shore&#039;, &#039;twentyeleven&#039; )\n\t\t),\n\t\t&#039;trolley&#039; =&gt; array(\n\t\t\t&#039;url&#039; =&gt; &#039;%s\/images\/headers\/trolley.jpg&#039;,\n\t\t\t&#039;thumbnail_url&#039; =&gt; &#039;%s\/images\/headers\/trolley-thumbnail.jpg&#039;,\n\t\t\t\/* translators: header image description *\/\n\t\t\t&#039;description&#039; =&gt; __( &#039;Trolley&#039;, &#039;twentyeleven&#039; )\n\t\t),\n\t\t&#039;pine-cone&#039; =&gt; array(\n\t\t\t&#039;url&#039; =&gt; &#039;%s\/images\/headers\/pine-cone.jpg&#039;,\n\t\t\t&#039;thumbnail_url&#039; =&gt; &#039;%s\/images\/headers\/pine-cone-thumbnail.jpg&#039;,\n\t\t\t\/* translators: header image description *\/\n\t\t\t&#039;description&#039; =&gt; __( &#039;Pine Cone&#039;, &#039;twentyeleven&#039; )\n\t\t),\n\t\t&#039;chessboard&#039; =&gt; array(\n\t\t\t&#039;url&#039; =&gt; &#039;%s\/images\/headers\/chessboard.jpg&#039;,\n\t\t\t&#039;thumbnail_url&#039; =&gt; &#039;%s\/images\/headers\/chessboard-thumbnail.jpg&#039;,\n\t\t\t\/* translators: header image description *\/\n\t\t\t&#039;description&#039; =&gt; __( &#039;Chessboard&#039;, &#039;twentyeleven&#039; )\n\t\t),\n\t\t&#039;lanterns&#039; =&gt; array(\n\t\t\t&#039;url&#039; =&gt; &#039;%s\/images\/headers\/lanterns.jpg&#039;,\n\t\t\t&#039;thumbnail_url&#039; =&gt; &#039;%s\/images\/headers\/lanterns-thumbnail.jpg&#039;,\n\t\t\t\/* translators: header image description *\/\n\t\t\t&#039;description&#039; =&gt; __( &#039;Lanterns&#039;, &#039;twentyeleven&#039; )\n\t\t),\n\t\t&#039;willow&#039; =&gt; array(\n\t\t\t&#039;url&#039; =&gt; &#039;%s\/images\/headers\/willow.jpg&#039;,\n\t\t\t&#039;thumbnail_url&#039; =&gt; &#039;%s\/images\/headers\/willow-thumbnail.jpg&#039;,\n\t\t\t\/* translators: header image description *\/\n\t\t\t&#039;description&#039; =&gt; __( &#039;Willow&#039;, &#039;twentyeleven&#039; )\n\t\t),\n\t\t&#039;hanoi&#039; =&gt; array(\n\t\t\t&#039;url&#039; =&gt; &#039;%s\/images\/headers\/hanoi.jpg&#039;,\n\t\t\t&#039;thumbnail_url&#039; =&gt; &#039;%s\/images\/headers\/hanoi-thumbnail.jpg&#039;,\n\t\t\t\/* translators: header image description *\/\n\t\t\t&#039;description&#039; =&gt; __( &#039;Hanoi Plant&#039;, &#039;twentyeleven&#039; )\n\t\t)\n\t) );\n}\nendif; \/\/ twentyeleven_setup\n\nif ( ! function_exists( &#039;twentyeleven_header_style&#039; ) ) :\n\/**\n * Styles the header image and text displayed on the blog.\n *\n * @since Twenty Eleven 1.0\n *\/\nfunction twentyeleven_header_style() {\n\t$text_color = get_header_textcolor();\n\n\t\/\/ If no custom options for text are set, let&#039;s bail.\n\tif ( $text_color == HEADER_TEXTCOLOR )\n\t\treturn;\n\n\t\/\/ If we get this far, we have custom styles. Let&#039;s do this.\n\t?&gt;\n\t&lt;style type=&quot;text\/css&quot; id=&quot;twentyeleven-header-css&quot;&gt;\n\t&lt;?php\n\t\t\/\/ Has the text been hidden?\n\t\tif ( &#039;blank&#039; == $text_color ) :\n\t?&gt;\n\t\t#site-title,\n\t\t#site-description {\n\t\t\tposition: absolute;\n\t\t\tclip: rect(1px 1px 1px 1px); \/* IE6, IE7 *\/\n\t\t\tclip: rect(1px, 1px, 1px, 1px);\n\t\t}\n\t&lt;?php\n\t\t\/\/ If the user has set a custom color for the text use that\n\t\telse :\n\t?&gt;\n\t\t#site-title a,\n\t\t#site-description {\n\t\t\tcolor: #&lt;?php echo $text_color; ?&gt;;\n\t\t}\n\t&lt;?php endif; ?&gt;\n\t&lt;\/style&gt;\n\t&lt;?php\n}\nendif; \/\/ twentyeleven_header_style\n\nif ( ! function_exists( &#039;twentyeleven_admin_header_style&#039; ) ) :\n\/**\n * Styles the header image displayed on the Appearance &gt; Header admin panel.\n *\n * Referenced via add_theme_support(&#039;custom-header&#039;) in twentyeleven_setup().\n *\n * @since Twenty Eleven 1.0\n *\/\nfunction twentyeleven_admin_header_style() {\n?&gt;\n\t&lt;style type=&quot;text\/css&quot; id=&quot;twentyeleven-admin-header-css&quot;&gt;\n\t.appearance_page_custom-header #headimg {\n\t\tborder: none;\n\t}\n\t#headimg h1,\n\t#desc {\n\t\tfont-family: &quot;Helvetica Neue&quot;, Arial, Helvetica, &quot;Nimbus Sans L&quot;, sans-serif;\n\t}\n\t#headimg h1 {\n\t\tmargin: 0;\n\t}\n\t#headimg h1 a {\n\t\tfont-size: 32px;\n\t\tline-height: 36px;\n\t\ttext-decoration: none;\n\t}\n\t#desc {\n\t\tfont-size: 14px;\n\t\tline-height: 23px;\n\t\tpadding: 0 0 3em;\n\t}\n\t&lt;?php\n\t\t\/\/ If the user has set a custom color for the text use that\n\t\tif ( get_header_textcolor() != HEADER_TEXTCOLOR ) :\n\t?&gt;\n\t\t#site-title a,\n\t\t#site-description {\n\t\t\tcolor: #&lt;?php echo get_header_textcolor(); ?&gt;;\n\t\t}\n\t&lt;?php endif; ?&gt;\n\t#headimg img {\n\t\tmax-width: 1000px;\n\t\theight: auto;\n\t\twidth: 100%;\n\t}\n\t&lt;\/style&gt;\n&lt;?php\n}\nendif; \/\/ twentyeleven_admin_header_style\n\nif ( ! function_exists( &#039;twentyeleven_admin_header_image&#039; ) ) :\n\/**\n * Custom header image markup displayed on the Appearance &gt; Header admin panel.\n *\n * Referenced via add_theme_support(&#039;custom-header&#039;) in twentyeleven_setup().\n *\n * @since Twenty Eleven 1.0\n *\/\nfunction twentyeleven_admin_header_image() { ?&gt;\n\t&lt;div id=&quot;headimg&quot;&gt;\n\t\t&lt;?php\n\t\t$color = get_header_textcolor();\n\t\t$image = get_header_image();\n\t\t$style = &#039;display: none;&#039;;\n\t\tif ( $color &amp;&amp; $color != &#039;blank&#039; ) {\n\t\t\t$style = &#039;color: #&#039; . $color . &#039;;&#039;;\n\t\t}\n\t\t?&gt;\n\t\t&lt;h1 class=&quot;displaying-header-text&quot;&gt;&lt;a id=&quot;name&quot; style=&quot;&lt;?php echo esc_attr( $style ); ?&gt;&quot; onclick=&quot;return false;&quot; href=&quot;&lt;?php echo esc_url( home_url( &#039;\/&#039; ) ); ?&gt;&quot; tabindex=&quot;-1&quot;&gt;&lt;?php bloginfo( &#039;name&#039; ); ?&gt;&lt;\/a&gt;&lt;\/h1&gt;\n\t\t&lt;div id=&quot;desc&quot; class=&quot;displaying-header-text&quot; style=&quot;&lt;?php echo esc_attr( $style ); ?&gt;&quot;&gt;&lt;?php bloginfo( &#039;description&#039; ); ?&gt;&lt;\/div&gt;\n  \t\t&lt;?php if ( $image ) : ?&gt;\n\t\t\t&lt;img src=&quot;&lt;?php echo esc_url( $image ); ?&gt;&quot; alt=&quot;&quot; \/&gt;\n\t\t&lt;?php endif; ?&gt;\n\t&lt;\/div&gt;\n&lt;?php }\nendif; \/\/ twentyeleven_admin_header_image\n\n\/**\n * Set the post excerpt length to 40 words.\n *\n * To override this length in a child theme, remove\n * the filter and add your own function tied to\n * the excerpt_length filter hook.\n *\n * @since Twenty Eleven 1.0\n *\n * @param int $length The number of excerpt characters.\n * @return int The filtered number of characters.\n *\/\nfunction twentyeleven_excerpt_length( $length ) {\n\treturn 40;\n}\nadd_filter( &#039;excerpt_length&#039;, &#039;twentyeleven_excerpt_length&#039; );\n\nif ( ! function_exists( &#039;twentyeleven_continue_reading_link&#039; ) ) :\n\/**\n * Return a &quot;Continue Reading&quot; link for excerpts\n *\n * @since Twenty Eleven 1.0\n *\n * @return string The &quot;Continue Reading&quot; HTML link.\n *\/\nfunction twentyeleven_continue_reading_link() {\n\treturn &#039; &lt;a href=&quot;&#039;. esc_url( get_permalink() ) . &#039;&quot;&gt;&#039; . __( &#039;Continue reading &lt;span class=&quot;meta-nav&quot;&gt;&amp;rarr;&lt;\/span&gt;&#039;, &#039;twentyeleven&#039; ) . &#039;&lt;\/a&gt;&#039;;\n}\nendif; \/\/ twentyeleven_continue_reading_link\n\n\/**\n * Replace &quot;[...]&quot; in the Read More link with an ellipsis.\n *\n * The &quot;[...]&quot; is appended to automatically generated excerpts.\n *\n * To override this in a child theme, remove the filter and add your own\n * function tied to the excerpt_more filter hook.\n *\n * @since Twenty Eleven 1.0\n *\n * @param string $more The Read More text.\n * @return The filtered Read More text.\n *\/\nfunction twentyeleven_auto_excerpt_more( $more ) {\n\tif ( ! is_admin() ) {\n\t\treturn &#039; &amp;hellip;&#039; . twentyeleven_continue_reading_link();\n\t}\n\treturn $more;\n}\nadd_filter( &#039;excerpt_more&#039;, &#039;twentyeleven_auto_excerpt_more&#039; );\n\n\/**\n * Add a pretty &quot;Continue Reading&quot; link to custom post excerpts.\n *\n * To override this link in a child theme, remove the filter and add your own\n * function tied to the get_the_excerpt filter hook.\n *\n * @since Twenty Eleven 1.0\n *\n * @param string $output The &quot;Continue Reading&quot; link.\n * @return string The filtered &quot;Continue Reading&quot; link.\n *\/\nfunction twentyeleven_custom_excerpt_more( $output ) {\n\tif ( has_excerpt() &amp;&amp; ! is_attachment() &amp;&amp; ! is_admin() ) {\n\t\t$output .= twentyeleven_continue_reading_link();\n\t}\n\treturn $output;\n}\nadd_filter( &#039;get_the_excerpt&#039;, &#039;twentyeleven_custom_excerpt_more&#039; );\n\n\/**\n * Show a home link for the wp_nav_menu() fallback, wp_page_menu().\n *\n * @since Twenty Eleven 1.0\n *\n * @param array $args The page menu arguments. @see wp_page_menu()\n * @return array The filtered page menu arguments.\n *\/\nfunction twentyeleven_page_menu_args( $args ) {\n\tif ( ! isset( $args[&#039;show_home&#039;] ) )\n\t\t$args[&#039;show_home&#039;] = true;\n\treturn $args;\n}\nadd_filter( &#039;wp_page_menu_args&#039;, &#039;twentyeleven_page_menu_args&#039; );\n\n\/**\n * Register sidebars and widgetized areas.\n *\n * Also register the default Epherma widget.\n *\n * @since Twenty Eleven 1.0\n *\/\nfunction twentyeleven_widgets_init() {\n\n\tregister_widget( &#039;Twenty_Eleven_Ephemera_Widget&#039; );\n\n\tregister_sidebar( array(\n\t\t&#039;name&#039; =&gt; __( &#039;Main Sidebar&#039;, &#039;twentyeleven&#039; ),\n\t\t&#039;id&#039; =&gt; &#039;sidebar-1&#039;,\n\t\t&#039;before_widget&#039; =&gt; &#039;&lt;aside id=&quot;%1$s&quot; class=&quot;widget %2$s&quot;&gt;&#039;,\n\t\t&#039;after_widget&#039; =&gt; &#039;&lt;\/aside&gt;&#039;,\n\t\t&#039;before_title&#039; =&gt; &#039;&lt;h3 class=&quot;widget-title&quot;&gt;&#039;,\n\t\t&#039;after_title&#039; =&gt; &#039;&lt;\/h3&gt;&#039;,\n\t) );\n\n\tregister_sidebar( array(\n\t\t&#039;name&#039; =&gt; __( &#039;Showcase Sidebar&#039;, &#039;twentyeleven&#039; ),\n\t\t&#039;id&#039; =&gt; &#039;sidebar-2&#039;,\n\t\t&#039;description&#039; =&gt; __( &#039;The sidebar for the optional Showcase Template&#039;, &#039;twentyeleven&#039; ),\n\t\t&#039;before_widget&#039; =&gt; &#039;&lt;aside id=&quot;%1$s&quot; class=&quot;widget %2$s&quot;&gt;&#039;,\n\t\t&#039;after_widget&#039; =&gt; &#039;&lt;\/aside&gt;&#039;,\n\t\t&#039;before_title&#039; =&gt; &#039;&lt;h3 class=&quot;widget-title&quot;&gt;&#039;,\n\t\t&#039;after_title&#039; =&gt; &#039;&lt;\/h3&gt;&#039;,\n\t) );\n\n\tregister_sidebar( array(\n\t\t&#039;name&#039; =&gt; __( &#039;Footer Area One&#039;, &#039;twentyeleven&#039; ),\n\t\t&#039;id&#039; =&gt; &#039;sidebar-3&#039;,\n\t\t&#039;description&#039; =&gt; __( &#039;An optional widget area for your site footer&#039;, &#039;twentyeleven&#039; ),\n\t\t&#039;before_widget&#039; =&gt; &#039;&lt;aside id=&quot;%1$s&quot; class=&quot;widget %2$s&quot;&gt;&#039;,\n\t\t&#039;after_widget&#039; =&gt; &#039;&lt;\/aside&gt;&#039;,\n\t\t&#039;before_title&#039; =&gt; &#039;&lt;h3 class=&quot;widget-title&quot;&gt;&#039;,\n\t\t&#039;after_title&#039; =&gt; &#039;&lt;\/h3&gt;&#039;,\n\t) );\n\n\tregister_sidebar( array(\n\t\t&#039;name&#039; =&gt; __( &#039;Footer Area Two&#039;, &#039;twentyeleven&#039; ),\n\t\t&#039;id&#039; =&gt; &#039;sidebar-4&#039;,\n\t\t&#039;description&#039; =&gt; __( &#039;An optional widget area for your site footer&#039;, &#039;twentyeleven&#039; ),\n\t\t&#039;before_widget&#039; =&gt; &#039;&lt;aside id=&quot;%1$s&quot; class=&quot;widget %2$s&quot;&gt;&#039;,\n\t\t&#039;after_widget&#039; =&gt; &#039;&lt;\/aside&gt;&#039;,\n\t\t&#039;before_title&#039; =&gt; &#039;&lt;h3 class=&quot;widget-title&quot;&gt;&#039;,\n\t\t&#039;after_title&#039; =&gt; &#039;&lt;\/h3&gt;&#039;,\n\t) );\n\n\tregister_sidebar( array(\n\t\t&#039;name&#039; =&gt; __( &#039;Footer Area Three&#039;, &#039;twentyeleven&#039; ),\n\t\t&#039;id&#039; =&gt; &#039;sidebar-5&#039;,\n\t\t&#039;description&#039; =&gt; __( &#039;An optional widget area for your site footer&#039;, &#039;twentyeleven&#039; ),\n\t\t&#039;before_widget&#039; =&gt; &#039;&lt;aside id=&quot;%1$s&quot; class=&quot;widget %2$s&quot;&gt;&#039;,\n\t\t&#039;after_widget&#039; =&gt; &#039;&lt;\/aside&gt;&#039;,\n\t\t&#039;before_title&#039; =&gt; &#039;&lt;h3 class=&quot;widget-title&quot;&gt;&#039;,\n\t\t&#039;after_title&#039; =&gt; &#039;&lt;\/h3&gt;&#039;,\n\t) );\n}\nadd_action( &#039;widgets_init&#039;, &#039;twentyeleven_widgets_init&#039; );\n\nif ( ! function_exists( &#039;twentyeleven_content_nav&#039; ) ) :\n\/**\n * Display navigation to next\/previous pages when applicable.\n *\n * @since Twenty Eleven 1.0\n *\n * @param string $html_id The HTML id attribute.\n *\/\nfunction twentyeleven_content_nav( $html_id ) {\n\tglobal $wp_query;\n\n\tif ( $wp_query-&gt;max_num_pages &gt; 1 ) : ?&gt;\n\t\t&lt;nav id=&quot;&lt;?php echo esc_attr( $html_id ); ?&gt;&quot;&gt;\n\t\t\t&lt;h3 class=&quot;assistive-text&quot;&gt;&lt;?php _e( &#039;Post navigation&#039;, &#039;twentyeleven&#039; ); ?&gt;&lt;\/h3&gt;\n\t\t\t&lt;div class=&quot;nav-previous&quot;&gt;&lt;?php next_posts_link( __( &#039;&lt;span class=&quot;meta-nav&quot;&gt;&amp;larr;&lt;\/span&gt; Older posts&#039;, &#039;twentyeleven&#039; ) ); ?&gt;&lt;\/div&gt;\n\t\t\t&lt;div class=&quot;nav-next&quot;&gt;&lt;?php previous_posts_link( __( &#039;Newer posts &lt;span class=&quot;meta-nav&quot;&gt;&amp;rarr;&lt;\/span&gt;&#039;, &#039;twentyeleven&#039; ) ); ?&gt;&lt;\/div&gt;\n\t\t&lt;\/nav&gt;&lt;!-- #nav-above --&gt;\n\t&lt;?php endif;\n}\nendif; \/\/ twentyeleven_content_nav\n\n\/**\n * Return the first link from the post content. If none found, the\n * post permalink is used as a fallback.\n *\n * @since Twenty Eleven 1.0\n *\n * @uses get_url_in_content() to get the first URL from the post content.\n *\n * @return string The first link.\n *\/\nfunction twentyeleven_get_first_url() {\n\t$content = get_the_content();\n\t$has_url = function_exists( &#039;get_url_in_content&#039; ) ? get_url_in_content( $content ) : false;\n\n\tif ( ! $has_url )\n\t\t$has_url = twentyeleven_url_grabber();\n\n\t\/** This filter is documented in wp-includes\/link-template.php *\/\n\treturn ( $has_url ) ? $has_url : apply_filters( &#039;the_permalink&#039;, get_permalink() );\n}\n\n\/**\n * Return the URL for the first link found in the post content.\n *\n * @since Twenty Eleven 1.0\n *\n * @return string|bool URL or false when no link is present.\n *\/\nfunction twentyeleven_url_grabber() {\n\tif ( ! preg_match( &#039;\/&lt;a\\s[^&gt;]*?href=[\\&#039;&quot;](.+?)[\\&#039;&quot;]\/is&#039;, get_the_content(), $matches ) )\n\t\treturn false;\n\n\treturn esc_url_raw( $matches[1] );\n}\n\n\/**\n * Count the number of footer sidebars to enable dynamic classes for the footer.\n *\n * @since Twenty Eleven 1.0\n *\/\nfunction twentyeleven_footer_sidebar_class() {\n\t$count = 0;\n\n\tif ( is_active_sidebar( &#039;sidebar-3&#039; ) )\n\t\t$count++;\n\n\tif ( is_active_sidebar( &#039;sidebar-4&#039; ) )\n\t\t$count++;\n\n\tif ( is_active_sidebar( &#039;sidebar-5&#039; ) )\n\t\t$count++;\n\n\t$class = &#039;&#039;;\n\n\tswitch ( $count ) {\n\t\tcase &#039;1&#039;:\n\t\t\t$class = &#039;one&#039;;\n\t\t\tbreak;\n\t\tcase &#039;2&#039;:\n\t\t\t$class = &#039;two&#039;;\n\t\t\tbreak;\n\t\tcase &#039;3&#039;:\n\t\t\t$class = &#039;three&#039;;\n\t\t\tbreak;\n\t}\n\n\tif ( $class )\n\t\techo &#039;class=&quot;&#039; . esc_attr( $class ) . &#039;&quot;&#039;;\n}\n\nif ( ! function_exists( &#039;twentyeleven_comment&#039; ) ) :\n\/**\n * Template for comments and pingbacks.\n *\n * To override this walker in a child theme without modifying the comments template\n * simply create your own twentyeleven_comment(), and that function will be used instead.\n *\n * Used as a callback by wp_list_comments() for displaying the comments.\n *\n * @since Twenty Eleven 1.0\n *\n * @param object $comment The comment object.\n * @param array  $args    An array of comment arguments. @see get_comment_reply_link()\n * @param int    $depth   The depth of the comment.\n *\/\nfunction twentyeleven_comment( $comment, $args, $depth ) {\n\t$GLOBALS[&#039;comment&#039;] = $comment;\n\tswitch ( $comment-&gt;comment_type ) :\n\t\tcase &#039;pingback&#039; :\n\t\tcase &#039;trackback&#039; :\n\t?&gt;\n\t&lt;li class=&quot;post pingback&quot;&gt;\n\t\t&lt;p&gt;&lt;?php _e( &#039;Pingback:&#039;, &#039;twentyeleven&#039; ); ?&gt; &lt;?php comment_author_link(); ?&gt;&lt;?php edit_comment_link( __( &#039;Edit&#039;, &#039;twentyeleven&#039; ), &#039;&lt;span class=&quot;edit-link&quot;&gt;&#039;, &#039;&lt;\/span&gt;&#039; ); ?&gt;&lt;\/p&gt;\n\t&lt;?php\n\t\t\tbreak;\n\t\tdefault :\n\t?&gt;\n\t&lt;li &lt;?php comment_class(); ?&gt; id=&quot;li-comment-&lt;?php comment_ID(); ?&gt;&quot;&gt;\n\t\t&lt;article id=&quot;comment-&lt;?php comment_ID(); ?&gt;&quot; class=&quot;comment&quot;&gt;\n\t\t\t&lt;footer class=&quot;comment-meta&quot;&gt;\n\t\t\t\t&lt;div class=&quot;comment-author vcard&quot;&gt;\n\t\t\t\t\t&lt;?php\n\t\t\t\t\t\t$avatar_size = 68;\n\t\t\t\t\t\tif ( &#039;0&#039; != $comment-&gt;comment_parent )\n\t\t\t\t\t\t\t$avatar_size = 39;\n\n\t\t\t\t\t\techo get_avatar( $comment, $avatar_size );\n\n\t\t\t\t\t\t\/* translators: 1: comment author, 2: date and time *\/\n\t\t\t\t\t\tprintf( __( &#039;%1$s on %2$s &lt;span class=&quot;says&quot;&gt;said:&lt;\/span&gt;&#039;, &#039;twentyeleven&#039; ),\n\t\t\t\t\t\t\tsprintf( &#039;&lt;span class=&quot;fn&quot;&gt;%s&lt;\/span&gt;&#039;, get_comment_author_link() ),\n\t\t\t\t\t\t\tsprintf( &#039;&lt;a href=&quot;%1$s&quot;&gt;&lt;time datetime=&quot;%2$s&quot;&gt;%3$s&lt;\/time&gt;&lt;\/a&gt;&#039;,\n\t\t\t\t\t\t\t\tesc_url( get_comment_link( $comment-&gt;comment_ID ) ),\n\t\t\t\t\t\t\t\tget_comment_time( &#039;c&#039; ),\n\t\t\t\t\t\t\t\t\/* translators: 1: date, 2: time *\/\n\t\t\t\t\t\t\t\tsprintf( __( &#039;%1$s at %2$s&#039;, &#039;twentyeleven&#039; ), get_comment_date(), get_comment_time() )\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\t\t\t\t\t?&gt;\n\n\t\t\t\t\t&lt;?php edit_comment_link( __( &#039;Edit&#039;, &#039;twentyeleven&#039; ), &#039;&lt;span class=&quot;edit-link&quot;&gt;&#039;, &#039;&lt;\/span&gt;&#039; ); ?&gt;\n\t\t\t\t&lt;\/div&gt;&lt;!-- .comment-author .vcard --&gt;\n\n\t\t\t\t&lt;?php if ( $comment-&gt;comment_approved == &#039;0&#039; ) : ?&gt;\n\t\t\t\t\t&lt;em class=&quot;comment-awaiting-moderation&quot;&gt;&lt;?php _e( &#039;Your comment is awaiting moderation.&#039;, &#039;twentyeleven&#039; ); ?&gt;&lt;\/em&gt;\n\t\t\t\t\t&lt;br \/&gt;\n\t\t\t\t&lt;?php endif; ?&gt;\n\n\t\t\t&lt;\/footer&gt;\n\n\t\t\t&lt;div class=&quot;comment-content&quot;&gt;&lt;?php comment_text(); ?&gt;&lt;\/div&gt;\n\n\t\t\t&lt;div class=&quot;reply&quot;&gt;\n\t\t\t\t&lt;?php comment_reply_link( array_merge( $args, array( &#039;reply_text&#039; =&gt; __( &#039;Reply &lt;span&gt;&amp;darr;&lt;\/span&gt;&#039;, &#039;twentyeleven&#039; ), &#039;depth&#039; =&gt; $depth, &#039;max_depth&#039; =&gt; $args[&#039;max_depth&#039;] ) ) ); ?&gt;\n\t\t\t&lt;\/div&gt;&lt;!-- .reply --&gt;\n\t\t&lt;\/article&gt;&lt;!-- #comment-## --&gt;\n\n\t&lt;?php\n\t\t\tbreak;\n\tendswitch;\n}\nendif; \/\/ ends check for twentyeleven_comment()\n\nif ( ! function_exists( &#039;twentyeleven_posted_on&#039; ) ) :\n\/**\n * Print HTML with meta information for the current post-date\/time and author.\n *\n * Create your own twentyeleven_posted_on to override in a child theme\n *\n * @since Twenty Eleven 1.0\n *\/\nfunction twentyeleven_posted_on() {\nprintf( __( &#039;&lt;span class=&quot;sep&quot;&gt;Posted on &lt;\/span&gt;&lt;a href=&quot;%1$s&quot; title=&quot;%2$s&quot; rel=&quot;bookmark&quot;&gt;&lt;time class=&quot;entry-date updated&quot; datetime=&quot;%3$s&quot; pubdate=&quot;&quot;&gt;%4$s&lt;\/time&gt;&lt;\/a&gt;&lt;span class=&quot;by-author&quot;&gt; &lt;span class=&quot;sep&quot;&gt; by &lt;\/span&gt; &lt;span class=&quot;author vcard&quot;&gt;&lt;a class=&quot;url fn n&quot; title=&quot;%6$s&quot; href=&quot;%5$s&quot; rel=&quot;author&quot;&gt;%7$s&lt;\/a&gt;&lt;\/span&gt;&lt;\/span&gt;&#039;, &#039;twentyeleven&#039; ),\nesc_url( get_permalink() ),\nesc_attr( get_the_time() ),\nesc_attr( get_the_date( &#039;c&#039; ) ),\nesc_html( get_the_date() ),\nesc_url( get_author_posts_url( get_the_author_meta( &#039;ID&#039; ) ) ),\nesc_attr( sprintf( __( &#039;View all posts by %s&#039;, &#039;twentyeleven&#039; ), get_the_author() ) ),\nget_the_author()\n);\n}\n\nendif;\n\n\/**\n * Add two classes to the array of body classes.\n *\n * The first is if the site has only had one author with published posts.\n * The second is if a singular post being displayed\n *\n * @since Twenty Eleven 1.0\n *\n * @param array $classes Existing body classes.\n * @return array The filtered array of body classes.\n *\/\nfunction twentyeleven_body_classes( $classes ) {\n\n\tif ( function_exists( &#039;is_multi_author&#039; ) &amp;&amp; ! is_multi_author() )\n\t\t$classes[] = &#039;single-author&#039;;\n\n\tif ( is_singular() &amp;&amp; ! is_home() &amp;&amp; ! is_page_template( &#039;showcase.php&#039; ) &amp;&amp; ! is_page_template( &#039;sidebar-page.php&#039; ) )\n\t\t$classes[] = &#039;singular&#039;;\n\n\treturn $classes;\n}\nadd_filter( &#039;body_class&#039;, &#039;twentyeleven_body_classes&#039; );\n\n\/**\n * Retrieve the IDs for images in a gallery.\n *\n * @uses get_post_galleries() First, if available. Falls back to shortcode parsing,\n *                            then as last option uses a get_posts() call.\n *\n * @since Twenty Eleven 1.6\n *\n * @return array List of image IDs from the post gallery.\n *\/\nfunction twentyeleven_get_gallery_images() {\n\t$images = array();\n\n\tif ( function_exists( &#039;get_post_galleries&#039; ) ) {\n\t\t$galleries = get_post_galleries( get_the_ID(), false );\n\t\tif ( isset( $galleries[0][&#039;ids&#039;] ) )\n\t\t\t$images = explode( &#039;,&#039;, $galleries[0][&#039;ids&#039;] );\n\t} else {\n\t\t$pattern = get_shortcode_regex();\n\t\tpreg_match( &quot;\/$pattern\/s&quot;, get_the_content(), $match );\n\t\t$atts = shortcode_parse_atts( $match[3] );\n\t\tif ( isset( $atts[&#039;ids&#039;] ) )\n\t\t\t$images = explode( &#039;,&#039;, $atts[&#039;ids&#039;] );\n\t}\n\n\tif ( ! $images ) {\n\t\t$images = get_posts( array(\n\t\t\t&#039;fields&#039;         =&gt; &#039;ids&#039;,\n\t\t\t&#039;numberposts&#039;    =&gt; 999,\n\t\t\t&#039;order&#039;          =&gt; &#039;ASC&#039;,\n\t\t\t&#039;orderby&#039;        =&gt; &#039;menu_order&#039;,\n\t\t\t&#039;post_mime_type&#039; =&gt; &#039;image&#039;,\n\t\t\t&#039;post_parent&#039;    =&gt; get_the_ID(),\n\t\t\t&#039;post_type&#039;      =&gt; &#039;attachment&#039;,\n\t\t) );\n\t}\n\n\treturn $images;\n}<\/code><\/pre>\n<p>https:\/\/wordpress.org\/plugins\/jetpack\/<\/p>\n","protected":false},"template":"","class_list":["post-7109342","topic","type-topic","status-publish","hentry","topic-tag-function-php","topic-tag-subscriptions"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/7109342","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/7109342\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=7109342"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}