next previous links de las entradas no aparecen

Inicio Foros WordPress Themes y Diseño next previous links de las entradas no aparecen

Etiquetado: , , , , ,

Este debate contiene 0 respuestas, tiene 1 mensaje y lo actualizó  alvaroacevedo2 hace 9 años, 2 meses.

  • Autor
    Publicaciones
  • #13778

    alvaroacevedo2
    Participante

    <p>No consigo que aparezcan los links para el post siguiente o anterior. solo sale la imagen sin posibilidad de avanzar o retroceder.</p>
    <p>Hay alguna manera de que aparezcan?</p>
    <p>Gracias por adelantado.</p>
    <p>Esta es la web</p>
    <p>http://www.alvaro-acevedo.com/</p&gt;
    <p>Este es el código.</p>
    <p>&lt;?php<br />
    /*<br />
    Template Name: Index Template<br />
    */</p>
    <p>get_header();</p>
    <p>if (have_posts()):<br />
    while (have_posts()) : the_post();<br />
    if( $post-&gt;image ) :<br />
    // Build navigation links, image and imagemap<br />
    // This is mostly adapted stuff from the grain theme<br />
    $next = get_next_post(1);<br />
    $previous = get_previous_post(1);</p>
    <p> // decide navigational messages and links<br />
    $navigation_state = 0;</p>
    <p> if( $previous != null ) :<br />
    $message_prev = NAV_PREVIOUS;<br />
    $title_prev = TITLE_PREVIOUS;<br />
    $link_prev = get_permalink($previous-&gt;ID);<br />
    $navlink_prev = buildLink($link_prev, $message_prev);<br />
    else:<br />
    $message_prev = NAV_NO_PREVIOUS;<br />
    $title_prev = TITLE_NO_PREVIOUS;<br />
    $link_prev = ‘#’;<br />
    $navlink_prev = $message_prev;<br />
    $navigation_state = 1;<br />
    endif;</p>
    <p> if( $next != null ) :<br />
    $message_next = NAV_NEXT;<br />
    $title_next = TITLE_NEXT;<br />
    $link_next = get_permalink($next-&gt;ID);<br />
    $navlink_next = buildLink($link_next, $message_next);<br />
    else:<br />
    $message_next = NAV_NO_NEXT;<br />
    $title_next = TITLE_NO_NEXT;<br />
    $link_next = ‘#’;<br />
    $navlink_next = $message_next;<br />
    $navigation_state = 1;<br />
    endif;</p>
    <p> $navlink_center = monolit_get_comments_link();</p>
    <p> // decide which dimensions the image shall have<br />
    $dimensions = getimagesize($post-&gt;image-&gt;systemFilePath());<br />
    $width = $dimensions[0];<br />
    $height = $dimensions[1];</p>
    <p> // recude image width to 900<br />
    if ( $width &gt; 900 ) :<br />
    $height = $height * 900 / $width;<br />
    $width = 900;<br />
    endif;</p>
    <p> // recude image height to configure value<br />
    if ( $height &gt; MONOLIT_SET_MAX_HEIGHT ) :<br />
    $width = $width * MONOLIT_SET_MAX_HEIGHT / $height;<br />
    $height = MONOLIT_SET_MAX_HEIGHT;<br />
    endif;</p>
    <p> // calculate half the image with for use with imagemap<br />
    $width2 = (int)($width / 2);</p>
    <p> // correct odd image widths<br />
    $right_width = $width2;<br />
    if ( 2*$width2 &lt; $width )<br />
    $right_width++;</p>
    <p> // decide which title to output<br />
    $title_attr = ”;<br />
    if ( $navigation_state != 0 )<br />
    $title_attr = ($navigation_state &gt; 0) ? $title_next : $title_prev;</p>
    <p> // build and output photo<br />
    $thephoto = ‘&lt;div id=&quot;image&quot;&gt;’;<br />
    $thephoto .= ‘&lt;img class=&quot;photo&quot; ‘;<br />
    $thephoto .= ‘title=&quot;’ . $title_attr . ‘&quot; ‘;<br />
    $thephoto .= ‘alt=&quot;’ . $post-&gt;post_title . ‘&quot; ‘;<br />
    $thephoto .= ‘style=&quot;width: ‘ . $width . ‘px; height: ‘ . $height . ‘px;&quot; ‘;<br />
    $thephoto .= ‘width=&quot;’ . $width . ‘&quot; height=&quot;’ . $height . ‘&quot; ‘;<br />
    $thephoto .= ‘src=&quot;’ . $post-&gt;image-&gt;uri . ‘&quot; ‘;<br />
    $thephoto .= ‘usemap=&quot;#bloglinks&quot; ‘;<br />
    $thephoto .= ‘/&gt;’;<br />
    $thephoto .= ‘&lt;/div&gt;’ . &quot;n&quot;;<br />
    print $thephoto;</p>
    <p> // build and output imagemap<br />
    $imagemap = ‘&lt;map name=&quot;bloglinks&quot; id=&quot;bloglinks&quot;&gt;’.&quot;n&quot;;</p>
    <p> if ( $previous != null ) :<br />
    $imagemap .= ‘&lt;area shape=&quot;rect&quot; ‘;<br />
    $imagemap .= ‘coords=&quot;0,0,’ . $width2 . ‘,’ . $height . ‘&quot; ‘;<br />
    $imagemap .= ‘title=&quot;’ . $message_prev . ‘&quot; ‘;<br />
    $imagemap .= ‘alt=&quot;’ . $message_prev . ‘&quot; ‘;<br />
    $imagemap .= ‘href=&quot;’ . get_permalink($previous-&gt;ID) . ‘&quot; ‘;<br />
    $imagemap .= ‘/&gt;’ . &quot;n&quot;;<br />
    endif;</p>
    <p> if ( $next != null ) :<br />
    $imagemap .= ‘&lt;area shape=&quot;rect&quot; ‘;<br />
    $imagemap .= ‘coords=&quot;’ . $width2 . ‘,0,’ . ($right_width+$width2) . ‘,’ . $height . ‘&quot; ‘;<br />
    $imagemap .= ‘title=&quot;’ . $message_next . ‘&quot; ‘;<br />
    $imagemap .= ‘alt=&quot;’ . $message_next . ‘&quot; ‘;<br />
    $imagemap .= ‘href=&quot;’ . get_permalink($next-&gt;ID) . ‘&quot; ‘;<br />
    $imagemap .= ‘/&gt;’ . &quot;n&quot;;<br />
    endif;</p>
    <p> $imagemap .= ‘&lt;/map&gt;’ . &quot;n&quot;;<br />
    print $imagemap;</p>
    <p> // output image navigation bar<br />
    monolit_print_imagenavigation($navlink_prev, $navlink_center, $navlink_next);<br />
    else:<br />
    endif;</p>
    <p> // output the title, author, date, and content of the post in a container<br />
    monolit_print_container(null, monolit_get_postoutput());<br />
    // output the comments and comment form<br />
    monolit_print_info();<br />
    endwhile;<br />
    else:<br />
    endif;</p>
    <p>get_footer();<br />
    ?&gt;
    </p>

El foro ‘Themes y Diseño’ está cerrado y no se permiten nuevos debates ni respuestas.

Pin It on Pinterest