Plugins

Foro WordPress » WordPress » Plugins

Asunto Page Navi Plugin (4 mensajes)

Acerca de este hilo

Tags

Etiquetas:

  1. locovip

    2.0
    Antiguedad: Oct 2011
    Mensajes: 5

    offline

    Publicado hace 7 meses
    #

    El caso es que no sé dónde colocar <?php wp_pagenavi(); ?> del plugin PageNavi en mi theme. Tiene la siguiente estructura:

    if ($pages > 1) {
        $output[] = '< div class="pagination" >';

        $range_start = max($page - $range, 1);
        $range_end   = min($page + $range - 1, $pages);

        if ($page > 1) {
            $link     = ($type === 'posts') ? get_pagenum_link(1) : get_comments_pagenum_link(1);
            $output[] = '<a href="'.$link.'">'.__('First', 'warp').'</a>';

            $link     = ($type === 'posts') ? get_pagenum_link($page-1) : get_comments_pagenum_link($page-1);
            $output[] = '<a href="'.$link.'">«</a>';
        }

        for ($i = $range_start; $i < = $range_end; $i++) {
            if ($i == $page) {
                $output[] = '<strong>'.$i.'</strong>';
            } else {
                $link  = ($type === 'posts') ? get_pagenum_link($i) : get_comments_pagenum_link($i);
                $output[] = '<a href="'.$link.'">'.$i.'</a>';
            }
        }

        if ($page < $pages) {
            $link     = ($type === 'posts') ? get_pagenum_link($page+1) : get_comments_pagenum_link($page+1);
            $output[] = '<a href="'.$link.'">»</a>';   

            $link     = ($type === 'posts') ? get_pagenum_link($pages) : get_comments_pagenum_link($pages);
            $output[] = '<a href="'.$link.'">'.__('Last', 'warp').'</a>';
        }

        $output[] = '< /div >';

        echo implode("", $output);
    }

  2. VRtroper

    3.0
    Antiguedad: Abr 2009
    Mensajes: 47

    offline

    Publicado hace 7 meses
    #

    Prueba este plugin ami me fue muy bien http://wordpress.org/extend/plugins/wp-paginate/screenshots/
    sencillo facil de instalar y ningun problema hasta el momento. Ademas tiene en el .rar un readme donde te explica que lineas cambiar, etc.. no vas a tener problema.

  3. almendron

    5.0
    Antiguedad: Feb 2010
    Mensajes: 1.101

    offline

    Publicado hace 7 meses
    #

    Tienes que sustituir TODO el código que has indicado por <?php wp_pagenavi(); ?>

    Nota: sustituirás la paginación actual por la que muestra el plugin

  4. locovip

    2.0
    Antiguedad: Oct 2011
    Mensajes: 5

    offline

    Publicado hace 7 meses
    #

    Muchas gracias a VRtrooper y a almendron, el caso esque me dí cuenta que el theme ya llevaba incorporada la opción de paginación,así que todo correcto. Gracias de nuevo!!!

Responder

Debes Identificarte para publicar.

Foro WordPress » WordPress » Plugins