Foros del Web » Creando para Internet » Sistemas de gestión de contenidos » WordPress »

Mostrar siempre el título de los posts completos

Estas en el tema de Mostrar siempre el título de los posts completos en el foro de WordPress en Foros del Web. Buenas a todos. Tengo un problema. Dada la plantilla que he elegido para un sitio web, esta acorta todos los títulos de los posts. ¿ ...
  #1 (permalink)  
Antiguo 16/12/2013, 01:37
Avatar de rodrypaladin
Moderador
 
Fecha de Ingreso: abril-2010
Ubicación: Madrid
Mensajes: 2.127
Antigüedad: 14 años
Puntos: 468
Mostrar siempre el título de los posts completos

Buenas a todos. Tengo un problema. Dada la plantilla que he elegido para un sitio web, esta acorta todos los títulos de los posts.

¿ Como podría hacer para que esto no pasase y que se mostrasen todos los titulos completos ?
__________________
No te olvides de dar +1 a quien te echa un cable ;)
  #2 (permalink)  
Antiguo 16/12/2013, 02:57
Avatar de AlejandroGalvez  
Fecha de Ingreso: noviembre-2013
Mensajes: 189
Antigüedad: 10 años, 5 meses
Puntos: 49
Respuesta: Mostrar siempre el título de los posts completos

Otro caso de un desarrollador que resuelve sus problemas de diseño a lo burro... Nunca se deben acortar los títulos para que la plantilla quede bonita, afecta al SEO y al sentido común. ¿Imagináis un periódico con los titulares cortados para que encaje el contenido mejor? Una vez acabada la regañeta por si alguno me lee (no puedo evitarlo!) tus instrucciones:

Es posible que haya una función destinada a acortar los títulos, de ser así deberías encontrarla y modificarla. Probablemente esté en el archivo functions.php de tu tema. La forma más rápida de saber el nombre de la función que debes modificar es buscar en los archivos del tema la llamada a la misma. Si te acorta los títulos al mostrar los previews de las entradas en el blog deberías buscar en el archivo index.php o home.php.

Si la encuentras pero no te aclaras en cómo debes cambiar el código para que no acorte, copialo y pégalo aquí para que te ayudemos. Pero sin el código original poco podemos hacer.
  #3 (permalink)  
Antiguo 16/12/2013, 10:07
Avatar de rodrypaladin
Moderador
 
Fecha de Ingreso: abril-2010
Ubicación: Madrid
Mensajes: 2.127
Antigüedad: 14 años
Puntos: 468
Respuesta: Mostrar siempre el título de los posts completos

Hay tantos archivos y funciones que no sabría por donde empezar, puedo pegar el código del index.php principal de la plantilla, aver si sabéis donde está:

Código PHP:
Ver original
  1. <?php get_header(); ?>
  2. <?php if(get_option('tigu_homepage-news-ticker') == 'true' && get_option('tigu_newsticker_home') == 'true'): ?>
  3. <div class="newstickers" style="height:36px;"><?php jnewsticker_display( get_option('tigu_ticker_choosed_id') ) ?></div>
  4. <?php endif; ?>
  5. <!-- START MAIN AREA-->
  6.     <div id="main">
  7. <?php $fake_loop = new WP_Query('showposts=4'); while($fake_loop->have_posts()): $fake_loop->the_post(); ?>
  8. <?php endwhile; ?>
  9.  
  10. <?php if(get_option('tigu_featured_slider') == 'true'): ?>
  11. <?php require_once( trailingslashit( get_template_directory() ). '/includes/sliders/sliders.php' ); ?>
  12. <?php endif; ?>
  13.  
  14. <!-- START HOMEPAGE AREA -->
  15. <?php if(get_option('tigu_homepage_style') == 'magazine'): ?>
  16. <?php if (!function_exists('dynamic_sidebar') || !dynamic_sidebar('Homepage - Magazine Layout')): ?>
  17.  <div class="grids_box_sidebar"><div class="widget-title"><h3>
  18. <?php if( get_option('tigu_template_type', 'WordPres Default') == 'WordPres Default') : ?>
  19. <?php _e('Recent Posts', 'Gameleon'); ?>
  20. <?php else: ?>
  21. <?php _e('Recent Games', 'Gameleon'); ?>
  22. <?php endif; ?>
  23. </h3></div></div>
  24.      <div class="block archive">
  25.     <div class="block-rich">
  26. <?php
  27. $recent_posts = new WP_Query(array(
  28. 'showposts' => 5,
  29. ));
  30. ?>
  31. <?php
  32. $big_count = round(4 / 4);
  33. if(!$big_count) { $big_count = 1; }
  34. ?>
  35. <?php $counter = 1; while($recent_posts->have_posts()): $recent_posts->the_post(); ?>
  36. <?php
  37. if(has_post_format('video') || has_post_format('audio') || has_post_format('gallery')) {
  38. $icon = '<span class="' . get_post_format($post->ID) . '-icon"></span>';
  39. } else {
  40. $icon = '';
  41. }
  42. ?>
  43. <?php if($counter <= $big_count): ?>
  44.     <div class="high-grid">
  45. <?php if(has_post_thumbnail() || is_myarcade_game() ): ?>
  46. <?php $image = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'blog-style-image'); ?>
  47. <?php if ( empty($image[0]) ) $image[0] = myarcade_featured_image(); ?>
  48.     <div class="grid-image"><a class=<?php if( get_option('tigu_template_type', 'WordPres Default') == 'WordPres Default') : ?>"hover_play_small-wp"<?php else: ?>"hover_play_small"<?php endif; ?> href='<?php the_permalink(); ?>' title='<?php the_title(); ?>'>
  49. <?php if(get_option('tigu_timthumb') == 'true'): ?>
  50. <img src="<?php echo get_template_directory_uri(); ?>/scripts/timthumb.php?src=<?php echo $image[0]; ?>&amp;w=174&amp;h=100" alt="<?php ; ?>" />
  51. <?php else: ?>
  52. <img src="<?php echo $image[0]; ?>" width="174" height="100" alt="<?php the_title(); ?>" />
  53. <?php endif; ?>
  54. </a>
  55. <?php echo $icon; ?>
  56.     </div>
  57. <?php else: ?>
  58.   <div class="grid-image"><a href='<?php the_permalink(); ?>' title='<?php the_title(); ?>'>
  59. <img src="<?php echo get_template_directory_uri(); ?>/images/thumbnail.png" width="174" height="100" alt="<?php the_title(); ?>" />
  60. </a>
  61. <?php echo $icon; ?>
  62.   </div>
  63. <?php endif; ?>
  64.     <h2><a href='<?php the_permalink(); ?>' title='<?php the_title(); ?>'><?php the_title(); ?></a></h2>
  65.  
  66.  <p><?php echo get_excerpt(200); ?></p>
  67.     <?php paginate_links();
  68.     $args="";
  69.     wp_link_pages( $args );
  70.     ?>
  71.     </div>
  72. <?php else: ?>
  73.     <div class="high-grid">
  74. <?php if(has_post_thumbnail() || is_myarcade_game() ): ?>
  75. <?php $image = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'blog-style-image'); ?>
  76. <?php if ( empty($image[0]) ) $image[0] = myarcade_featured_image(); ?>
  77.       <div class="grid-image"><a class=<?php if( get_option('tigu_template_type', 'WordPres Default') == 'WordPres Default') : ?>"hover_play_small-wp"<?php else: ?>"hover_play_small"<?php endif; ?> href='<?php the_permalink(); ?>' title='<?php the_title(); ?>'>
  78. <?php if(get_option('tigu_timthumb') == 'true'): ?>
  79. <img src="<?php echo get_template_directory_uri(); ?>/scripts/timthumb.php?src=<?php echo $image[0]; ?>&amp;w=174&amp;h=100" alt="<?php the_title(); ?>" />
  80. <?php else: ?>
  81. <img src="<?php echo $image[0]; ?>" width="174" height="100" alt="<?php the_title(); ?>" />
  82. <?php endif; ?>
  83. </a>
  84. <?php echo $icon; ?>
  85.     </div>
  86. <?php else: ?>
  87.     <div class="grid-image"><a href='<?php the_permalink(); ?>' title='<?php the_title(); ?>'>
  88. <img src="<?php echo get_template_directory_uri(); ?>/images/thumbnail.png" width="174" height="100" alt="<?php the_title(); ?>" />
  89. </a>
  90. <?php echo $icon; ?>
  91.     </div>
  92. <?php endif; ?>
  93.     <h2><a href='<?php the_permalink(); ?>' title='<?php the_title(); ?>'><?php the_title(); ?></a></h2>
  94. <p><?php echo get_excerpt(200); ?></p>
  95.     </div>
  96. <?php endif; ?>
  97. <?php $counter++; endwhile; ?>
  98.     </div></div>
  99. <?php endif; ?>
  100. <?php endif; ?>
  101.  
  102. <?php if(get_option('tigu_homepage_style', 'blog') == 'blog'): ?>
  103. <div class="grids_box_sidebar">
  104. <div class="widget-title">
  105. <h3>
  106.  
  107. <?php if( get_option('tigu_template_type', 'WordPres Default') == 'WordPres Default') : ?>
  108. <?php _e('Recent Posts', 'Gameleon'); ?>
  109. <?php else: ?>
  110. <?php _e('Recent Games', 'Gameleon'); ?>
  111. <?php endif; ?>
  112.  
  113. </h3>
  114. </div>
  115. </div>
  116.     <div class="block archive">
  117.     <div class="block-rich">
  118. <?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; ?>
  119. <?php $blog = new WP_Query('showposts='.$posts_per_page.'&paged='.$paged); ?>
  120.  
  121. <?php
  122.     $posts_per_page = get_option('tigu_homeblog_post_number');
  123.     $blog->query('showposts='.$posts_per_page.'&paged='.$paged);
  124. ?>
  125.  
  126. <?php if ($blog->have_posts()) : while ($blog->have_posts()) : $blog->the_post(); ?>
  127.     <div id="post-<?php the_ID(); ?>" <?php post_class('high-grid'); ?>>
  128. <?php
  129.     if(has_post_format('video') || has_post_format('audio') || has_post_format('gallery')) {
  130.     $icon = '<span class="' . get_post_format($post->ID) . '-icon"></span>';
  131. } else {
  132. $icon = '';
  133. }
  134. ?>
  135. <?php if(has_post_thumbnail() || is_myarcade_game()): ?>
  136. <?php $image = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'blog-style-image'); ?>
  137. <?php if ( empty($image[0]) ) $image[0] = myarcade_featured_image(); ?>
  138. <div class="grid-image"><a class=<?php if( get_option('tigu_template_type', 'WordPres Default') == 'WordPres Default') : ?>"hover_play_small-wp"<?php else: ?>"hover_play_small"<?php endif; ?> href='<?php the_permalink(); ?>' title='<?php the_title(); ?>'>
  139. <?php if(get_option('tigu_timthumb') == 'true'): ?>
  140. <img src="<?php echo get_template_directory_uri(); ?>/scripts/timthumb.php?src=<?php echo $image[0]; ?>&amp;w=174&amp;h=100" alt="<?php the_title(); ?>" />
  141. <?php else: ?>
  142. <img src="<?php echo $image[0]; ?>" width="174" height="100" alt="<?php the_title(); ?>" />
  143. <?php endif; ?>
  144. </a><?php echo $icon; ?></div>
  145. <?php else: ?>
  146. <div class="grid-image"><a href='<?php the_permalink(); ?>' title='<?php the_title(); ?>'>
  147. <img src="<?php echo get_template_directory_uri(); ?>/images/thumbnail.png" width="174" height="100" alt="<?php the_title(); ?>" />
  148. </a><?php echo $icon; ?></div>
  149. <?php endif; ?>
  150.  
  151.   <h2><a href='<?php the_permalink(); ?>' title='<?php the_title(); ?>'><?php the_title(); ?></a></h2>
  152. <div class="somepadd block-metas">
  153. <?php if(get_option('tigu_postdatetime_blog-layout', 'true') == 'true'): ?>
  154. <span class="postdatetime-wp">
  155. <?php the_time('Y-m-d') ?>
  156. </span>
  157. <?php endif; ?>
  158.  
  159. <?php if(get_option('tigu_mostplayed-blog-layout', 'true') == 'true'): ?>
  160. <?php if( get_option('tigu_template_type', 'WordPres Default') == 'WordPres Default') : ?>
  161. <span class="postviews-wp" title="<?php _e('Views', 'Gameleon'); ?>: <?php echo getMostPlayed(get_the_ID()); ?> "><?php _e('Views', 'Gameleon'); ?>: <?php echo getMostPlayed(get_the_ID()); ?></span>
  162. <?php else: ?>
  163. <span class="clubs" title="<?php _e('Played', 'Gameleon'); ?>: <?php echo getMostPlayed(get_the_ID()); ?> "><?php echo getMostPlayed(get_the_ID()); ?> <?php _e('plays', 'Gameleon'); ?></span>
  164. <?php endif; ?>
  165. <?php endif; ?>
  166.  
  167. <?php if(get_option('tigu_likes-blog-layout', 'true') == 'true'): ?>
  168. <span class="minilikes">
  169. <?php _e('Likes', 'Gameleon'); ?>: <?php echo $wp_superlike->show_likes($post->ID);?>
  170. </span>
  171. <?php endif; ?>
  172.  
  173. <?php if(get_option('tigu_comments-blog-layout', 'false') == 'true'): ?>
  174. <?php $comment_count = get_comment_count($post->ID); ?>
  175. <?php if ($comment_count['approved'] > 0) : ?>
  176. <?php comments_popup_link( '0', '1', '%', 'heading-comments-exist'); ?>
  177. <?php else: ?>
  178. <?php comments_popup_link( '0', '1', '%', 'heading-comments'); ?>
  179. <?php endif; ?>
  180. <?php endif; ?>
  181.  
  182. </div>
  183.  
  184.      <p><?php echo get_excerpt(get_option('tigu_blog_homepage_excerpt', '270')); ?></p>
  185.     </div>
  186.  
  187. <?php endwhile; endif; ?>
  188.  
  189.     </div>
  190.  
  191.     </div>
  192.     <div style='padding-top: 20px;'>
  193. <?php if (!function_exists('dynamic_sidebar') || !dynamic_sidebar('Homepage - Blog Layout')): ?>
  194. <?php endif; ?>
  195.     </div>
  196. <?php endif; ?>
  197. <!-- END HOMEPAGE AREA -->
  198. <?php if(get_option('tigu_pagination', 'false') == 'true' && get_option('tigu_homepage_style', 'blog') == 'blog'): ?>
  199. <?php kriesi_pagination($pages = '', $range = 2); ?>
  200. <?php endif; ?>
  201.     </div>
  202. <!-- END MAIN AREA-->
  203. <?php get_sidebar(); ?>
  204. <?php get_footer(); ?>
__________________
No te olvides de dar +1 a quien te echa un cable ;)
  #4 (permalink)  
Antiguo 16/12/2013, 10:45
Avatar de AlejandroGalvez  
Fecha de Ingreso: noviembre-2013
Mensajes: 189
Antigüedad: 10 años, 5 meses
Puntos: 49
Respuesta: Mostrar siempre el título de los posts completos

Aparentemente todos los títulos de las noticias de tu homepage se llaman correctamente mediante la función the_title() así que tal vez se esté aplicando un filtro a dicha función. Busca en el archivo functions.php una línea parecida a esta:

Código PHP:
Ver original
  1. apply_filters( 'the_title', 'este_sera_el_nombre_de_la_funcion_que_quieres_modificar' )

Otra pregunta, cuando dices que acorta todos los títulos, ¿te refieres a que añade puntos suspensivos al final de todos los títulos? ¿Solo en los widgets o en toda la web?
  #5 (permalink)  
Antiguo 16/12/2013, 10:47
Avatar de rodrypaladin
Moderador
 
Fecha de Ingreso: abril-2010
Ubicación: Madrid
Mensajes: 2.127
Antigüedad: 14 años
Puntos: 468
Respuesta: Mostrar siempre el título de los posts completos

Tengo dos archivos functions y en ninguno aparece al buscar the_title Mirare en el resto pq dentro de la carpeta include hay muchos archivos php tambien con funciones.
__________________
No te olvides de dar +1 a quien te echa un cable ;)
  #6 (permalink)  
Antiguo 16/12/2013, 10:50
Avatar de rodrypaladin
Moderador
 
Fecha de Ingreso: abril-2010
Ubicación: Madrid
Mensajes: 2.127
Antigüedad: 14 años
Puntos: 468
Respuesta: Mostrar siempre el título de los posts completos

Encontré este archivo donde si que he encontrado esos caracteres.

Código PHP:
Ver original
  1. <?php
  2. /**
  3.  * MyArcadePlugin Theme API  - Helps theme developers to create MyArcadePlugin compatible themes.
  4.  *
  5.  * @package MyArcadePlugin Theme API
  6.  * @author Daniel Bakovic - http://myarcadeplugin.com
  7.  *
  8.  * @version 1.0.0
  9.  */
  10.  
  11.  
  12. if ( !function_exists('myarcade_title')) {
  13.   /**
  14.   * Display or retrieve the title of the current post/game. The title can be cutted after x characters.
  15.   * Words will not be cutted off (wordwrap).
  16.   *
  17.   * @usage Use this function only in the WordPress post loop
  18.   *
  19.   * @since 1.0
  20.   *
  21.   * @param int $chars Optional. Max. length of the title
  22.   * @param bool $echo Optional. default to true. Whether to display or return.
  23.   * @return string $title String if $echo parameter is false.
  24.   */
  25.   function myarcade_title ($chars = 0, $echo = true) {
  26.  
  27.     $title = strip_tags( the_title('', '', FALSE) );
  28.  
  29.     if ( $chars > 0 ) {
  30.       if ( (strlen($title) > $chars) ) {
  31.         $title = mb_substr($title, 0, $chars);
  32.         $title = mb_substr($title, 0, -strlen(strrchr($title, ' ')));  // Wordwrap
  33.  
  34.         if ( strlen($title) < 4 ) {
  35.           $title = mb_substr( the_title('', '',FALSE), 0, $chars );
  36.         }
  37.  
  38.         $title .= ' ..';
  39.       }
  40.     }
  41.  
  42.     if ($echo == true) { echo $title; } else { return $title; }
  43.   }
  44. }
  45.  
  46.  
  47. if ( !function_exists('myarcade_excerpt')) {
  48.   /**
  49.   * Display or retrieve the excerpt of a game post. All tags will be removed.
  50.   *
  51.   * @usage Use this function only in the WordPress post loop
  52.   *
  53.   * @since 1.0
  54.   *
  55.   * @param int $length Character length of the excerpt
  56.   * @param bool $echo Optional. Return or echo the result
  57.   */
  58.   function myarcade_excerpt($length = false, $echo = true) {
  59.     global $post;
  60.  
  61.     // Get post excerpt
  62.     $text = strip_shortcodes( $post->post_content );
  63.     $text = apply_filters('the_content', $text);
  64.     $text = str_replace(']]>', ']]&gt;', $text);
  65.     $text = wp_trim_words( $text, 100, '' );  
  66.  
  67.     if ( $length ) {
  68.       if ( strlen($text) > $length ) {
  69.         $text = mb_substr($text, 0, $length).' [...]';
  70.       }
  71.     }
  72.  
  73.     if ($echo) { echo $text; } else { return $text; }
  74.   }
  75. }
  76.  
  77.  
  78. if ( !function_exists('myarcade_thumbnail')) {
  79.   /**
  80.   * Display the game thumbnail of the current game.
  81.   * If no thumbnail is available the function will display a default thumbnail located in the template directory.
  82.   *
  83.   * default thumb: /template_directory/images/def_thumb.png
  84.   *
  85.   * @usage Use this function only in the WordPress post loop
  86.   *
  87.   * @since 1.0
  88.   *
  89.   * @param int $width Optional. Width of the thumbnail in px. Default: 100
  90.   * @param int $height Optional. Height of the thumbnail in px. Default: 100
  91.   * @param string $class Optional. CSS class for the image tag
  92.   */
  93.   function myarcade_thumbnail ($width = 100, $height = 100, $class = '') {
  94.     global $post;
  95.  
  96.     if ( !empty($class) ) { $class = 'class="'.$class.'"'; }
  97.  
  98.     $thumbnail = get_post_meta($post->ID, "mabp_thumbnail_url", true);
  99.  
  100.     if ( preg_match('|^(http).*|i', $thumbnail) == 0 ) {
  101.       // No Thumbail available.. get the default thumb
  102.      
  103.       $thumbnail = get_template_directory_uri().'/images/def_thumb.png';
  104.      
  105.       if ( !file_exists($thumbnail) ) {
  106.         $thumbnail = MYARCADE_URL .'/templates/assets/images/def_thumb.png';
  107.       }
  108.     }
  109.  
  110.     $args = array( 'before' => '', 'after' => '', 'echo' => false );
  111.  
  112.     echo '<img src="'.$thumbnail.'" width="'.$width.'" height="'.$height.'" '.$class.' alt="'.the_title_attribute( $args ).'" />';
  113.   }
  114. }
  115.  
  116.  
  117. if ( !function_exists('myarcade_get_thumbnail_url')) {
  118.   /**
  119.   * Get the url of the current game thumbnail
  120.   *
  121.   * @usage Use this function only in the WordPress post loop
  122.   *
  123.   * @since 1.0
  124.   */
  125.   function myarcade_get_thumbnail_url() {
  126.     global $post;  
  127.     return get_post_meta($post->ID, "mabp_thumbnail_url", true);
  128.   }
  129. }
  130.  
  131.  
  132. if ( !function_exists('myarcade_count_screenshots')) {
  133.   /**
  134.   * Get the number of available screenshots for the current game.
  135.   *
  136.   * @usage Use this function only in the WordPress post loop
  137.   *
  138.   * @since 1.0
  139.   *
  140.   * @return int Number of screenshots
  141.   */
  142.   function myarcade_count_screenshots () {
  143.     global $post;
  144.  
  145.     $screen_count = 0;
  146.  
  147.     for ($screen_nr = 1; $screen_nr <= 4; $screen_nr++) {  
  148.       if ( preg_match('|^(http).*|i', get_post_meta($post->ID, "mabp_screen".$screen_nr."_url", true)) ) {
  149.         $screen_count++;
  150.       }
  151.     }
  152.  
  153.     return intval($screen_count);
  154.   }
  155. }
  156.  
  157.  
  158. if ( !function_exists('myarcade_screenshot')) {
  159.   /**
  160.   * Display the given screenshot of the current game.
  161.   *
  162.   * @usage Use this function only in the WordPress post loop
  163.   *
  164.   * @since 1.0
  165.   *
  166.   * @param int $width Optional. Width of the screen shot in px. Default: 450
  167.   * @param int $height Optional. Height of the screen shot in px. Default: 350
  168.   * @param int $number Optional. The number of the screenshot (1..4). Default 1
  169.   * @param string $class Optional. CSS class fot the image tag
  170.   */
  171.   function myarcade_screenshot ($width = 450, $height = 300, $number = 1, $class = '') {
  172.     global $post;
  173.  
  174.     if ( !empty($class) ) { $class = 'class="'.$class.'"'; }
  175.  
  176.     $screenshot = get_post_meta($post->ID, "mabp_screen".$number."_url", true);
  177.  
  178.     if ( preg_match('|^(http).*|i', $screenshot) ) {
  179.       $args = array( 'before' => '', 'after' => '', 'echo' => false );
  180.       echo '<img src="'.$screenshot.'"  width="'.$width.'" height="'.$height.'" '.$class.' alt="'.the_title_attribute( $args ).'" />';
  181.     }
  182.   }
  183. }
  184.  
  185.  
  186. if ( !function_exists('myarcade_get_screenshot_url')) {
  187.   /**
  188.   * Retrieves the screenshot url for the current game
  189.   *
  190.   * @usage Use this function only in the WordPress post loop
  191.   *
  192.   * @since 1.0
  193.   *
  194.   * @param int $number Optional. The number of the screenshot (1..4). Default 1
  195.   * @param bool $echo Optional. Return or echo the result
  196.   */
  197.   function myarcade_get_screenshot_url ($number = 1, $echo = true) {
  198.     global $post;
  199.  
  200.     $screenshot = get_post_meta($post->ID, "mabp_screen".$number."_url", true);
  201.  
  202.     if ( $echo == true ) { echo $screenshot; } else { return $screenshot; }
  203.   }
  204. }
  205.  
  206.  
  207. if ( !function_exists('myarcade_all_screenshots')) {
  208.   /**
  209.   * Display all available screenshots of the current game.
  210.   *
  211.   * @usage Use this function only in the WordPress post loop
  212.   *
  213.   * @since 1.0
  214.   *
  215.   * @param int $width Optional. Width of the screen shot in px. Default: 450
  216.   * @param int $height Optional. Height of the screen shot in px. Default: 350
  217.   * @param int $screen_nr Optional. The number of the screen (1..4). Default 1
  218.   * @param string $class Optional. CSS class fot the image tag
  219.   */
  220.   function myarcade_all_screenshots ($width = 450, $height = 300, $class = '') {
  221.     global $post;
  222.  
  223.     $args = array( 'before' => '', 'after' => '', 'echo' => false );
  224.  
  225.     if ( !empty($class) ) { $class = 'class="'.$class.'"'; }  
  226.  
  227.     for ($screen_nr = 1; $screen_nr <= 4; $screen_nr++) {
  228.       $screenshot = get_post_meta($post->ID, "mabp_screen".$screen_nr."_url", true);
  229.  
  230.       if ( preg_match('|^(http).*|i', $screenshot) ) {      
  231.         echo '<a href="'.$screenshot.'" title="'.the_title_attribute( $args ).'" rel="prettyPhoto[slides]"><img src="'.$screenshot.'"  width="'.$width.'" height="'.$height.'" '.$class.' alt="'.the_title_attribute( $args ).'" /></a>';
  232.       }
  233.     }
  234.   }
  235. }
  236.  
  237. if ( !function_exists( 'is_myarcade_game') ) {
  238.   /**
  239.    * Checks is the current post is a MyArcadePlugin game
  240.    *
  241.    * @return boolean
  242.    */
  243.   function is_myarcade_game() {    
  244.     if ( defined('MYARCADE_VERSION') && function_exists( 'is_game') ) {
  245.       return is_game();
  246.     }
  247.     return false;
  248.   }
  249. }
  250.  
  251. if ( !function_exists( 'myarcade_featured_image' ) ) {
  252.   /**
  253.    * Return a featured image url.
  254.    * Function added for the Gameleon theme
  255.    *
  256.    * @return string image url
  257.    */
  258.   function myarcade_featured_image() {  
  259.     $image = myarcade_get_screenshot_url(1, false);    
  260.     if ( !$image ) {
  261.       $image = myarcade_get_thumbnail_url();
  262.     }    
  263.     return $image;
  264.   }
  265. }
  266. ?>
__________________
No te olvides de dar +1 a quien te echa un cable ;)

Última edición por rodrypaladin; 16/12/2013 a las 11:04
  #7 (permalink)  
Antiguo 16/12/2013, 13:12
Avatar de AlejandroGalvez  
Fecha de Ingreso: noviembre-2013
Mensajes: 189
Antigüedad: 10 años, 5 meses
Puntos: 49
Respuesta: Mostrar siempre el título de los posts completos

Entonces parece que tu tema utiliza MyArcadePlugin como librería y este le provee una función para recuperar el título. Lo más cómodo para ti si de verdad quieres no cortar ni un solo título es modificar la primera función desde la línea 25 hasta la 44 y dejarlo así:

Código PHP:
function myarcade_title ($chars 0$echo true) {
 
    
$title strip_tagsthe_title(''''FALSE) );
 
    
/* COMENTADO PARA EVITAR QUE ACORTE LOS TÍTULOS!!!
    if ( $chars > 0 ) {
      if ( (strlen($title) > $chars) ) {
        $title = mb_substr($title, 0, $chars);
        $title = mb_substr($title, 0, -strlen(strrchr($title, ' ')));  // Wordwrap
 
        if ( strlen($title) < 4 ) {
          $title = mb_substr( the_title('', '',FALSE), 0, $chars );
        }
 
        $title .= ' ..';
      }
    } 
    */
 
    
if ($echo == true) { echo $title; } else { return $title; }
    

  #8 (permalink)  
Antiguo 16/12/2013, 15:00
Avatar de rodrypaladin
Moderador
 
Fecha de Ingreso: abril-2010
Ubicación: Madrid
Mensajes: 2.127
Antigüedad: 14 años
Puntos: 468
Respuesta: Mostrar siempre el título de los posts completos

Al modificarlo me salga error en ese archivo en la linea 268

EDITO: y no ha linea 268 ¿ Ehmm ?
__________________
No te olvides de dar +1 a quien te echa un cable ;)

Última edición por rodrypaladin; 16/12/2013 a las 15:19
  #9 (permalink)  
Antiguo 16/12/2013, 15:48
Avatar de AlejandroGalvez  
Fecha de Ingreso: noviembre-2013
Mensajes: 189
Antigüedad: 10 años, 5 meses
Puntos: 49
Respuesta: Mostrar siempre el título de los posts completos

Probablemente al sustituir no hayas cerrado bien los corchetes de la función o algún IF { }. Compruebalo, y también espero que hayas cerrado el comentario con */ tal como he puesto en el ejemplo.
  #10 (permalink)  
Antiguo 16/12/2013, 16:01
Avatar de rodrypaladin
Moderador
 
Fecha de Ingreso: abril-2010
Ubicación: Madrid
Mensajes: 2.127
Antigüedad: 14 años
Puntos: 468
Respuesta: Mostrar siempre el título de los posts completos

Ahora lo he puesto tal y como estaba, era hasta la linea 43, si lo hacia hasta la 44 se comia un corchete.

Pero siguen saliendo los títulos cortados
__________________
No te olvides de dar +1 a quien te echa un cable ;)
  #11 (permalink)  
Antiguo 18/12/2013, 18:18
Avatar de rodrypaladin
Moderador
 
Fecha de Ingreso: abril-2010
Ubicación: Madrid
Mensajes: 2.127
Antigüedad: 14 años
Puntos: 468
Respuesta: Mostrar siempre el título de los posts completos

Chic@s nadie sabe como solucionarlo ??
__________________
No te olvides de dar +1 a quien te echa un cable ;)
  #12 (permalink)  
Antiguo 18/12/2013, 19:45
Avatar de NUCKLEAR
Moderador radioactivo
 
Fecha de Ingreso: octubre-2005
Ubicación: Cordoba-Argentina
Mensajes: 5.688
Antigüedad: 18 años, 5 meses
Puntos: 890
Respuesta: Mostrar siempre el título de los posts completos

Tenés varias opciones para modificarlo, al parecer esa function es usada en el loop, lo mas fácil es decirle que no procese la function.


function myarcade_title ($chars = 0, $echo = true) {

$title = strip_tags( the_title('', '', FALSE) );

if ($echo == true) { echo $title; } else { return $title; } return false;

if ( $chars > 0 ) {
lo demas ................
__________________
Drupal Argentina
  #13 (permalink)  
Antiguo 18/12/2013, 20:00
Avatar de rodrypaladin
Moderador
 
Fecha de Ingreso: abril-2010
Ubicación: Madrid
Mensajes: 2.127
Antigüedad: 14 años
Puntos: 468
Respuesta: Mostrar siempre el título de los posts completos

He añadido la linea que me has dicho, pero siguen apareciendo, no paro de mirar y mirar pero veo donde mas hay que modificar algo :S
__________________
No te olvides de dar +1 a quien te echa un cable ;)
  #14 (permalink)  
Antiguo 18/12/2013, 20:48
Avatar de NUCKLEAR
Moderador radioactivo
 
Fecha de Ingreso: octubre-2005
Ubicación: Cordoba-Argentina
Mensajes: 5.688
Antigüedad: 18 años, 5 meses
Puntos: 890
Respuesta: Mostrar siempre el título de los posts completos

No, entonces asi adivinando va a estar dificil, en algun lado debe estar el filtro o la function...
Ese theme no es pago?
__________________
Drupal Argentina
  #15 (permalink)  
Antiguo 18/12/2013, 21:45
Avatar de rodrypaladin
Moderador
 
Fecha de Ingreso: abril-2010
Ubicación: Madrid
Mensajes: 2.127
Antigüedad: 14 años
Puntos: 468
Respuesta: Mostrar siempre el título de los posts completos

el theme es de pago si, lo tengo de hace tiempo
__________________
No te olvides de dar +1 a quien te echa un cable ;)
  #16 (permalink)  
Antiguo 19/12/2013, 07:03
elmajaron
Invitado
 
Mensajes: n/a
Puntos:
Respuesta: Mostrar siempre el título de los posts completos

Cita:
Iniciado por rodrypaladin Ver Mensaje
el theme es de pago si, lo tengo de hace tiempo
No se da soporte para themes ni plugins de pago un saludo.
  #17 (permalink)  
Antiguo 19/12/2013, 09:32
Avatar de rodrypaladin
Moderador
 
Fecha de Ingreso: abril-2010
Ubicación: Madrid
Mensajes: 2.127
Antigüedad: 14 años
Puntos: 468
Respuesta: Mostrar siempre el título de los posts completos

Vaya, no sabía yo eso, entonces pueden borrar el tema. Gracias
__________________
No te olvides de dar +1 a quien te echa un cable ;)

Etiquetas: post, posts, siempre
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 12:39.