{"id":12205,"date":"2011-02-20T15:53:34","date_gmt":"2011-02-20T15:53:34","guid":{"rendered":"https:\/\/wordpress.org\/plugins-wp\/is-latest-post\/"},"modified":"2011-10-02T11:05:13","modified_gmt":"2011-10-02T11:05:13","slug":"is-latest-post","status":"closed","type":"plugin","link":"https:\/\/wordpress.org\/plugins\/is-latest-post\/","author":7633351,"comment_status":"closed","ping_status":"closed","template":"","meta":{"version":"0.2","stable_tag":"trunk","tested":"3.2.1","requires":"3.2.1","requires_php":"","requires_plugins":"","header_name":"Is Latest Post?","header_author":"Guillermo Guti\u00e9rrez","header_description":"","assets_banners_color":"","last_updated":"2011-10-02 11:05:13","external_support_url":"","external_repository_url":"","donate_link":"http:\/\/greenpeace.org","header_plugin_uri":"http:\/\/www.programania.net\/wordpress-plugin-is-latest-post\/","header_author_uri":"http:\/\/ggalmazor.com","rating":0,"author_block_rating":0,"active_installs":10,"downloads":1223,"num_ratings":0,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq","changelog"],"tags":[],"upgrade_notice":{"":"<p>This plugin doesn&#039;t have configuration nor database storage. Just replace the files with the new package.<\/p>"},"ratings":{"1":0,"2":0,"3":0,"4":0,"5":0},"assets_icons":[],"assets_banners":[],"assets_blueprints":{},"all_blocks":[],"tagged_versions":[],"block_files":[],"assets_screenshots":[],"screenshots":[]},"plugin_section":[],"plugin_tags":[4977,526,86,90,975],"plugin_category":[43,57],"plugin_contributors":[97172],"plugin_business_model":[],"class_list":["post-12205","plugin","type-plugin","status-closed","hentry","plugin_tags-latest","plugin_tags-loop","plugin_tags-post","plugin_tags-tag","plugin_tags-template","plugin_category-customization","plugin_category-taxonomy","plugin_contributors-ggalmazor","plugin_committers-ggalmazor"],"banners":[],"icons":{"svg":false,"icon":"https:\/\/s.w.org\/plugins\/geopattern-icon\/is-latest-post.svg","icon_2x":false,"generated":true},"screenshots":[],"raw_content":"<!--section=description-->\n<p>This plugin adds a template tag called <em>is_latest()<\/em> to know if the <strong>current post<\/strong> in <em>the_loop()<\/em> is the <strong>latest post<\/strong>.<\/p>\n\n<h3>Examples<\/h3>\n\n<p><strong>Use h1 for the latest post's title, h2 in the remaining posts:<\/strong><\/p>\n\n<pre><code>&lt;?php \/\/ Code taken from TwentyTen loop.php file ?&gt;\n&lt;?php while ( have_posts() ) : the_post(); ?&gt;\n\n  \/\/ [...] blah blah blah\n\n  &lt;div id=\"post-&lt;?php the_ID(); ?&gt;\" &lt;?php post_class(); ?&gt;&gt;\n    &lt;h&lt;?php echo (is_latest()) ? \"1\" : \"2\" ?&gt; class=\"entry-title\"&gt;&lt;a href=\"&lt;?php the_permalink(); ?&gt;\" title=\"&lt;?php printf( esc_attr__( 'Permalink to %s', 'twentyten' ), the_title_attribute( 'echo=0' ) ); ?&gt;\" rel=\"bookmark\"&gt;&lt;?php the_title(); ?&gt;&lt;\/a&gt;&lt;\/h&lt;?php echo (is_latest()) ? \"1\" : \"2\" ?&gt;&gt;\n\n    \/\/ [...] rest of the post stuff\n  &lt;\/div&gt;\n\n  \/\/ [...] more blah blah blah\n\n&lt;?php endwhile; \/\/ End the loop. Whew. ?&gt;\n<\/code><\/pre>\n\n<p><strong>Show full content on latest post only, summary on rest:<\/strong><\/p>\n\n<pre><code>&lt;?php if (is_latest()): ?&gt;\n  &lt;?php the_content('Continue reading &lt;span class=\"meta-nav\"&gt;&amp;rarr;&lt;\/span&gt;'); ?&gt;\n&lt;?php else: ?&gt;\n  &lt;?php echo the_excerpt(); ?&gt;\n&lt;?php endif; ?&gt;\n<\/code><\/pre>\n\n<!--section=installation-->\n<ol>\n<li>Unzip the plugin package and upload it to <code>\/wp-content\/plugins\/<\/code> directory<\/li>\n<li>Activate the plugin through the 'Plugins' menu in WordPress<\/li>\n<li>Use your new <em>is_latest()<\/em> template tag in your theme's loops.<\/li>\n<\/ol>\n\n<!--section=faq-->\n<p>None yet. Be the first, I dare you!<\/p>\n\n<!--section=changelog-->\n<h4>0.2<\/h4>\n\n<ul>\n<li>Fixed sql query sentence for latest Wordpress versions (&gt; 3.2.1)<\/li>\n<li>Improved usage examples<\/li>\n<\/ul>\n\n<h4>0.1<\/h4>\n\n<ul>\n<li>First implementation<\/li>\n<li>Created readme.txt file<\/li>\n<\/ul>","raw_excerpt":"This plugin adds a template tag to know if the current post in the_loop() is the latest post.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/12205","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=12205"}],"author":[{"embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/ggalmazor"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=12205"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=12205"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=12205"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=12205"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=12205"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=12205"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}