{"id":5181,"date":"2012-05-03T21:19:02","date_gmt":"2012-05-03T21:19:02","guid":{"rendered":"https:\/\/es.wordpress.org\/support\/topic\/como-enlazar-las-imagenes-destacadas-a-su-vista-a-tamano-completo\/"},"modified":"2016-08-06T00:13:27","modified_gmt":"2016-08-06T00:13:27","slug":"como-enlazar-las-imagenes-destacadas-a-su-vista-a-tamano-completo","status":"closed","type":"topic","link":"https:\/\/es.wordpress.org\/support\/topic\/como-enlazar-las-imagenes-destacadas-a-su-vista-a-tamano-completo\/","title":{"rendered":"\u00bfC\u00f3mo enlazar las imagenes destacadas a su vista a tama\u00f1o completo?"},"content":{"rendered":"<p>Hola.<br \/>\nMi tema enlaza por defecto las im\u00e1genes destacadas de mis entradas a la propia entrada. Yo quer\u00eda enlazar las im\u00e1genes destacadas para que al hacer clic se abriera en una ventana nueva la vista a tama\u00f1o original del fichero de la imagen.<\/p>\n<p>Saludos y gracias de antemano.<br \/>\nRicard.<\/p>\n<p>Les adjunto mi \u00abfunction.php\u00bb por si les fuera de ayuda:<\/p>\n<pre><code>&lt;?php\n\/**\n* Theme functions used by the CyberChimps Response Core Framework\n*\n* Authors: Tyler Cunningham\n* Copyright: \u00a9 2012\n* {@link http:\/\/cyberchimps.com\/ CyberChimps LLC}\n*\n* Released under the terms of the GNU General Public License.\n* You should have received a copy of the GNU General Public License,\n* along with this software. In the main directory, see: \/licensing\/\n* If not, see: {@link http:\/\/www.gnu.org\/licenses\/}.\n*\n* @package Response\n* @since 1.0.5\n*\/\n\n\/**\n* Define global theme functions.\n*\/\n\t$themename = &#039;response&#039;;\n\t$themenamefull = &#039;Response&#039;;\n\t$themeslug = &#039;re&#039;;\n\t$pagedocs = &#039;http:\/\/cyberchimps.com\/question\/using-the-response-page-options\/&#039;;\n\t$sliderdocs = &#039;http:\/\/cyberchimps.com\/question\/how-to-use-the-response-slider\/&#039;;\n\t$root = get_template_directory_uri(); \n\n\/**\n* Basic theme setup.\n*\/\nfunction response_theme_setup() {\n\tglobal $content_width;\n\tif ( ! isset( $content_width ) ) $content_width = 608; \/\/Set content width\n\n\tadd_theme_support(\n\t\t&#039;post-formats&#039;,\n\t\tarray(&#039;aside&#039;, &#039;gallery&#039;, &#039;link&#039;, &#039;image&#039;, &#039;quote&#039;, &#039;status&#039;, &#039;video&#039;, &#039;audio&#039;, &#039;chat&#039;)\n\t);\n\n\tadd_theme_support( &#039;post-thumbnails&#039; );\n\tadd_theme_support(&#039;automatic-feed-links&#039;);\n\tadd_editor_style();\n\tadd_custom_background();\n}\nadd_action( &#039;after_setup_theme&#039;, &#039;response_theme_setup&#039; );\n\n\/**\n* Redirect user to theme options page after activation.\n*\/\nif ( is_admin() &amp;&amp; isset($_GET[&#039;activated&#039;] ) &amp;&amp; $pagenow ==&quot;themes.php&quot; ) {\n\twp_redirect( &#039;themes.php?page=response&#039; );\n}\n\n\/**\n* Add link to theme options in Admin bar.\n*\/\nfunction response_admin_link() {\n\tglobal $wp_admin_bar;\n\n\t$wp_admin_bar-&gt;add_menu( array( &#039;id&#039; =&gt; &#039;Response&#039;, &#039;title&#039; =&gt; &#039;Response Options&#039;, &#039;href&#039; =&gt; admin_url(&#039;themes.php?page=response&#039;)  ) );\n}\nadd_action( &#039;admin_bar_menu&#039;, &#039;response_admin_link&#039;, 113 );\n\n\/**\n* Custom markup for gallery posts in main blog index.\n*\/\nfunction response_custom_gallery_post_format( $content ) {\n\tglobal $options, $themeslug, $post;\n\t$root = get_template_directory_uri(); \n\n\tob_start();?&gt;\n\n\t\t&lt;?php if ($options-&gt;get($themeslug.&#039;_post_formats&#039;) == &#039;1&#039;) : ?&gt;\n\t\t\t&lt;div class=&quot;postformats&quot;&gt;&lt;!--begin format icon--&gt;\n\t\t\t\t&lt;img src=&quot;&lt;?php echo get_template_directory_uri(); ?&gt;\/images\/formats\/gallery.png&quot; \/&gt;\n\t\t\t&lt;\/div&gt;&lt;!--end format-icon--&gt;\n\t\t&lt;?php endif;?&gt;\n\t\t\t\t&lt;h2 class=&quot;posts_title&quot;&gt;&lt;a href=&quot;&lt;?php the_permalink() ?&gt;&quot;&gt;&lt;?php the_title(); ?&gt;&lt;\/a&gt;&lt;\/h2&gt;\n\t\t\t\t\t&lt;!--Call @Core Meta hook--&gt;\n\t\t\t&lt;?php response_post_byline(); ?&gt;\n\t\t\t\t&lt;?php\n\t\t\t\tif ( has_post_thumbnail() &amp;&amp; $options-&gt;get($themeslug.&#039;_show_featured_images&#039;) == &#039;1&#039; &amp;&amp; !is_single() ) {\n \t\t \t\t\techo &#039;&lt;div class=&quot;featured-image&quot;&gt;&#039;;\n \t\t \t\t\techo &#039;&lt;a href=&quot;&#039; . get_permalink($post-&gt;ID) . &#039;&quot; &gt;&#039;;\n \t\t \t\t\t\tthe_post_thumbnail();\n  \t\t\t\t\techo &#039;&lt;\/a&gt;&#039;;\n  \t\t\t\t\techo &#039;&lt;\/div&gt;&#039;;\n\t\t\t\t}\n\t\t\t?&gt;\n\t\t\t\t&lt;div class=&quot;entry&quot; &lt;?php if ( has_post_thumbnail() &amp;&amp; $options-&gt;get($themeslug.&#039;_show_featured_images&#039;) == &#039;1&#039; ) { echo &#039;style=&quot;min-height: 115px;&quot; &#039;; }?&gt;&gt;\n\n\t\t\t\t&lt;?php if (!is_single()): ?&gt;\n\t\t\t\t&lt;?php $images = get_children( array( &#039;post_parent&#039; =&gt; $post-&gt;ID, &#039;post_type&#039; =&gt; &#039;attachment&#039;, &#039;post_mime_type&#039; =&gt; &#039;image&#039;, &#039;orderby&#039; =&gt; &#039;menu_order&#039;, &#039;order&#039; =&gt; &#039;ASC&#039;, &#039;numberposts&#039; =&gt; 999 ) );\n\t\t\t\t\tif ( $images ) :\n\t\t\t\t\t\t$total_images = count( $images );\n\t\t\t\t\t\t$image = array_shift( $images );\n\t\t\t\t\t\t$image_img_tag = wp_get_attachment_image( $image-&gt;ID, &#039;thumbnail&#039; );\n\t\t\t\t?&gt;\n\n\t\t\t\t&lt;figure class=&quot;gallery-thumb&quot;&gt;\n\t\t\t\t\t&lt;a href=&quot;&lt;?php the_permalink(); ?&gt;&quot;&gt;&lt;?php echo $image_img_tag; ?&gt;&lt;\/a&gt;\n\t\t\t\t\t&lt;br \/&gt;&lt;br \/&gt;\n\t\t\t\t\tThis gallery contains &lt;?php echo $total_images ; ?&gt; images\n\t\t\t\t\t&lt;?php endif;?&gt;\n\t\t\t\t&lt;\/figure&gt;&lt;!-- .gallery-thumb --&gt;\n\t\t\t\t&lt;?php endif;?&gt;\n\n\t\t\t\t&lt;?php if (is_single()): ?&gt;\n\t\t\t\t\t&lt;?php the_content(); ?&gt;\n\t\t\t\t&lt;?php endif;?&gt;\n\t\t\t\t&lt;\/div&gt;&lt;!--end entry--&gt;\n\n\t\t\t\t&lt;div style=clear:both;&gt;&lt;\/div&gt;\n\t&lt;?php\n\t$content = ob_get_clean();\n\n\treturn $content;\n}\nadd_filter(&#039;response_post_formats_gallery_content&#039;, &#039;response_custom_gallery_post_format&#039; ); \n\n\/**\n* Set custom post excerpt link text based on theme option.\n*\/\nfunction response_excerpt_link($more) {\n\n\tglobal $themename, $themeslug, $options, $post;\n\n    \tif ($options-&gt;get($themeslug.&#039;_excerpt_link_text&#039;) == &#039;&#039;) {\n    \t\t$linktext = &#039;(Read More...)&#039;;\n   \t\t}\n    \telse {\n    \t\t$linktext = $options-&gt;get($themeslug.&#039;_excerpt_link_text&#039;);\n   \t\t}\n\n\treturn &#039;&lt;a href=&quot;&#039;. get_permalink($post-&gt;ID) . &#039;&quot;&gt; &lt;br \/&gt;&lt;br \/&gt; &#039;.$linktext.&#039;&lt;\/a&gt;&#039;;\n}\nadd_filter(&#039;excerpt_more&#039;, &#039;response_excerpt_link&#039;);\n\n\/**\n* Set custom post excerpt length based on theme option.\n*\/\nfunction response_excerpt_length($length) {\n\n\tglobal $themename, $themeslug, $options;\n\n\t\tif ($options-&gt;get($themeslug.&#039;_excerpt_length&#039;) == &#039;&#039;) {\n    \t\t$length = &#039;55&#039;;\n    \t}\n    \telse {\n    \t\t$length = $options-&gt;get($themeslug.&#039;_excerpt_length&#039;);\n    \t}\n\n\treturn $length;\n}\nadd_filter(&#039;excerpt_length&#039;, &#039;response_excerpt_length&#039;);\n\n\/**\n* Custom featured image size based on theme options.\n*\/\nfunction response_featured_image() {\n\tif ( function_exists( &#039;add_theme_support&#039; ) ) {\n\n\tglobal $themename, $themeslug, $options;\n\n\tif ($options-&gt;get($themeslug.&#039;_featured_image_height&#039;) == &#039;&#039;) {\n\t\t$featureheight = &#039;100&#039;;\n\t}\n\telse {\n\t\t$featureheight = $options-&gt;get($themeslug.&#039;_featured_image_height&#039;);\n\t}\n\tif ($options-&gt;get($themeslug.&#039;_featured_image_width&#039;) == &quot;&quot;) {\n\t\t\t$featurewidth = &#039;100&#039;;\n\t}\n\telse {\n\t\t$featurewidth = $options-&gt;get($themeslug.&#039;_featured_image_width&#039;);\n\t}\n\tset_post_thumbnail_size( $featurewidth, $featureheight, true );\n\t}\n}\nadd_action( &#039;init&#039;, &#039;response_featured_image&#039;, 11);\t\n\n\/**\n* Add Google Analytics support based on theme option.\n*\/\nfunction response_google_analytics() {\n\tglobal $themename, $themeslug, $options;\n\n\techo stripslashes ($options-&gt;get($themeslug.&#039;_ga_code&#039;));\n\n}\nadd_action(&#039;wp_head&#039;, &#039;response_google_analytics&#039;);\n\n\/**\n* Add custom header scripts support based on theme option.\n*\/\nfunction response_custom_scripts() {\n\tglobal $themename, $themeslug, $options;\n\n\techo stripslashes ($options-&gt;get($themeslug.&#039;_custom_header_scripts&#039;));\n\n}\nadd_action(&#039;wp_head&#039;, &#039;response_custom_scripts&#039;);\n\n\/**\n* Register custom menus for header, footer.\n*\/\nfunction response_register_menus() {\n\tregister_nav_menus(\n\tarray( &#039;header-menu&#039; =&gt; __( &#039;Header Menu&#039; ))\n  );\n}\nadd_action( &#039;init&#039;, &#039;response_register_menus&#039; );\n\n\/**\n* Menu fallback if custom menu not used.\n*\/\nfunction response_menu_fallback() {\n\tglobal $post; ?&gt;\n\n\t&lt;ul id=&quot;nav_menu&quot;&gt;\n\t\t&lt;?php wp_list_pages( &#039;title_li=&amp;sort_column=menu_order&amp;depth=3&#039;); ?&gt;\n\t&lt;\/ul&gt;&lt;?php\n}\n\/**\n* Register widgets.\n*\/\nfunction response_widgets_init() {\n    register_sidebar(array(\n    \t&#039;name&#039; =&gt; &#039;Full Sidebar&#039;,\n    \t&#039;id&#039;   =&gt; &#039;sidebar-widgets&#039;,\n    \t&#039;description&#039;   =&gt; &#039;These are widgets for the full sidebar.&#039;,\n    \t&#039;before_widget&#039; =&gt; &#039;&lt;div id=&quot;%1$s&quot; class=&quot;widget-container&quot;&gt;&#039;,\n    \t&#039;after_widget&#039;  =&gt; &#039;&lt;\/div&gt;&#039;,\n    \t&#039;before_title&#039;  =&gt; &#039;&lt;h2 class=&quot;widget-title&quot;&gt;&#039;,\n    \t&#039;after_title&#039;   =&gt; &#039;&lt;\/h2&gt;&#039;\n    ));\n    register_sidebar(array(\n    \t&#039;name&#039; =&gt; &#039;Left Half Sidebar&#039;,\n    \t&#039;id&#039;   =&gt; &#039;sidebar-left&#039;,\n    \t&#039;description&#039;   =&gt; &#039;These are widgets for the left half sidebar.&#039;,\n    \t&#039;before_widget&#039; =&gt; &#039;&lt;div id=&quot;%1$s&quot; class=&quot;widget-container&quot;&gt;&#039;,\n    \t&#039;after_widget&#039;  =&gt; &#039;&lt;\/div&gt;&#039;,\n    \t&#039;before_title&#039;  =&gt; &#039;&lt;h2 class=&quot;widget-title&quot;&gt;&#039;,\n    \t&#039;after_title&#039;   =&gt; &#039;&lt;\/h2&gt;&#039;\n    ));\n    register_sidebar(array(\n    \t&#039;name&#039; =&gt; &#039;Right Half Sidebar&#039;,\n    \t&#039;id&#039;   =&gt; &#039;sidebar-right&#039;,\n    \t&#039;description&#039;   =&gt; &#039;These are widgets for the right half sidebar.&#039;,\n    \t&#039;before_widget&#039; =&gt; &#039;&lt;div id=&quot;%1$s&quot; class=&quot;widget-container&quot;&gt;&#039;,\n    \t&#039;after_widget&#039;  =&gt; &#039;&lt;\/div&gt;&#039;,\n    \t&#039;before_title&#039;  =&gt; &#039;&lt;h2 class=&quot;widget-title&quot;&gt;&#039;,\n    \t&#039;after_title&#039;   =&gt; &#039;&lt;\/h2&gt;&#039;\n   \t));\n   \tregister_sidebar(array(\n\t\t&#039;name&#039; =&gt; &#039;Footer&#039;,\n\t\t&#039;id&#039; =&gt; &#039;footer-widgets&#039;,\n\t\t&#039;description&#039; =&gt; &#039;These are the footer widgets&#039;,\n\t\t&#039;before_widget&#039; =&gt; &#039;&lt;div class=&quot;three columns footer-widgets&quot;&gt;&#039;,\n\t\t&#039;after_widget&#039; =&gt; &#039;&lt;\/div&gt;&#039;,\n\t\t&#039;before_title&#039; =&gt; &#039;&lt;h3 class=&quot;footer-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;response_widgets_init&#039;);\n\n\/**\n* Initialize Response Core Framework.\n*\/\nrequire_once ( get_template_directory() . &#039;\/core\/core-init.php&#039; );\n\n\/**\n* Call additional files required by theme.\n*\/\nrequire_once ( get_template_directory() . &#039;\/includes\/classy-options-init.php&#039; ); \/\/ Theme options markup.\nrequire_once ( get_template_directory() . &#039;\/includes\/options-functions.php&#039; ); \/\/ Custom functions based on theme options.\nrequire_once ( get_template_directory() . &#039;\/includes\/meta-box.php&#039; ); \/\/ Meta options markup.\nrequire_once ( get_template_directory() . &#039;\/includes\/presstrends.php&#039; ); \/\/ Meta options markup.\n\n\/**\n* End\n*\/\n\n?&gt;<\/code><\/pre>\n","protected":false},"template":"","class_list":["post-5181","topic","type-topic","status-closed","hentry","topic-tag-enlace","topic-tag-imagen","topic-tag-imagen-destacada"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/es.wordpress.org\/support\/wp-json\/wp\/v2\/topic\/5181","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/es.wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/es.wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/es.wordpress.org\/support\/wp-json\/wp\/v2\/topic\/5181\/revisions"}],"wp:attachment":[{"href":"https:\/\/es.wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=5181"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}