Title: Gnarly Frontend Page Sort
Author: olie480
Published: <strong>25. juni, 2014</strong>
Last modified: 17. juli, 2014

---

Søg plugins

![](https://ps.w.org/gnarly-frontend-page-sorter/assets/banner-772x250.png?rev=950670)

Dette plugin **er ikke blevet testet med de seneste 3 større udgivelser af WordPress**.
Det vedligeholdes eller understøttes muligvis ikke længere og kan have kompatibilitetsproblemer,
når det bruges med nyere versioner af WordPress.

![](https://s.w.org/plugins/geopattern-icon/gnarly-frontend-page-sorter_fdfdfd.svg)

# Gnarly Frontend Page Sort

 Af [olie480](https://profiles.wordpress.org/olie480/)

[Download](https://downloads.wordpress.org/plugin/gnarly-frontend-page-sorter.1.0.zip)

 * [Detaljer](https://da.wordpress.org/plugins/gnarly-frontend-page-sorter/#description)
 * [Vurderinger](https://da.wordpress.org/plugins/gnarly-frontend-page-sorter/#reviews)
 *  [Installation](https://da.wordpress.org/plugins/gnarly-frontend-page-sorter/#installation)
 * [Udvikling](https://da.wordpress.org/plugins/gnarly-frontend-page-sorter/#developers)

 [Support](https://wordpress.org/support/plugin/gnarly-frontend-page-sorter/)

## Beskrivelse

Gives user the ability to order sub-pages on the parent page from the frontend of
WordPress.

There are some backend plugins that do this, but I recently had a project that had
about 30 parent pages, and those had sub-pages, and the sub-pages had sub-pages.
We needed to find an alternative solution on the frontend because the majority of
the plugins were drag and drop on the admin screen. This fixed this problem.

## Installation

This is the code I used to list the child pages on a parent page. I changed the 
sort_column to menu_order instead of the default post_title, and the sort_order 
is asc.

    ```
    <?php

        global $post;

        $args = array(          
            'hierarchical'  => 0,                       
            'child_of'      => 0,
            'parent'        => $post->ID,           
            'number'        => '',
            'sort_order'    =>  'asc',
            'sort_column'   =>  'menu_order'
        );

        $child_pages = get_pages( $args );  
    ?>
    ```

With the Child pages, I then created a custom loop (an example will be included 
later on in a separate file. I made 2 functions to spit out the pages of the parent
page). From there I can add the gnarly tags to the parent container and the child
items.

When you install the plugin, just find the template that controls your pages loop
and make the following modifications. This example uses Twenty-Fourteen as an example.

    ```
    <div role="main" class="site-content" id="content" data-gnarly-sort='true'>

        <article data-gnarly-id="58" class="page-58 page" id="page-58">
            <div class="entry-content">
                <h2>Your Page Title</h2>
            </div>
            <!-- .entry-content -->
        </article>
        <!-- #page-## -->    

        <article data-gnarly-id="57" class="page-57 page" id="page-57">
            <div class="entry-content">
                <h2>Your Page Title</h2>
            </div>
            <!-- .entry-content -->
        </article>
        <!-- #page-## -->    

        <article data-gnarly-id="56" class="page-56 page" id="page-56">
            <div class="entry-content">
                <h2>Your Page Title</h2>
            </div>
            <!-- .entry-content -->
        </article>
        <!-- #page-## -->    

        <article data-gnarly-id="55" class="page-55 page" id="page-55">
            <div class="entry-content">
                <h2>Your Page Title</h2>
            </div>
            <!-- .entry-content -->
        </article>
        <!-- #page-## -->    

    </div>
    ```

Notice the following code

    ```
    <div role="main" class="site-content" id="content" data-gnarly-sort="true">
    ```

The data-gnarly-sort=’true’ attribute tag. This tells the plug-in that it is the
parent element of the sorter.

On each of the pages that get spit out, you must include the data-gnarly-id=”58″
in order to tell the sorter that it is a page item that will be drag and drop sorted
using the page ID. This attribute is important because it tells wordpress what position
it’s in when you drag and drop each element by using the page ID. You can echo out
the page ID by using the following PHP pre in the loop.

    ```
    <article data-gnarly-id="<?php the_ID(); ?>" class="page-58 page" id="page-58"> 
    ```

#### Minimum Requirements

 * WordPress 3.9 or greater
 * PHP version 5.2.4 or greater
 * MySQL version 5.0 or greater

## FAQ

  I installed the plugin, I don’t know what to do.

Please follow the instructions in the readme.txt file in order to set up the plugin
correctly. Everyone’s themes are different, and I am currently working on a better
solution to specify the parent and child elements

## Anmeldelser

Der er ingen anmeldelser for denne widget.

## Bidragsydere & udviklere

“Gnarly Frontend Page Sort” er open source-software. Følgende personer har bidraget
til dette plugin.

Bidragsydere

 *   [ olie480 ](https://profiles.wordpress.org/olie480/)

[Oversæt “Gnarly Frontend Page Sort” til dit eget sprog.](https://translate.wordpress.org/projects/wp-plugins/gnarly-frontend-page-sorter)

### Interesseret i udvikling?

[Gennemse koden](https://plugins.trac.wordpress.org/browser/gnarly-frontend-page-sorter/),
tjek [SVN repository](https://plugins.svn.wordpress.org/gnarly-frontend-page-sorter/),
eller abonner på [udviklerloggen](https://plugins.trac.wordpress.org/log/gnarly-frontend-page-sorter/)
via [RSS](https://plugins.trac.wordpress.org/log/gnarly-frontend-page-sorter/?limit=100&mode=stop_on_copy&format=rss).

## Ændringslog

#### 1.0

 * Updated admin check in plugins main file

#### 1.0.0 – 06/24/2014

 * Initial Release

## Meta

 *  Version **1.0**
 *  Senest opdateret **12 år siden**
 *  Aktive installationer **10+**
 *  WordPress-version ** 3.9 eller højere **
 *  Testet op til **3.9.40**
 *  Sprog
 * [English (US)](https://wordpress.org/plugins/gnarly-frontend-page-sorter/)
 * Tags
 * [admin](https://da.wordpress.org/plugins/tags/admin/)[Frontend](https://da.wordpress.org/plugins/tags/frontend/)
   [pages](https://da.wordpress.org/plugins/tags/pages/)
 *  [Avanceret visning](https://da.wordpress.org/plugins/gnarly-frontend-page-sorter/advanced/)

## Bedømmelser

Der er endnu ikke indsendt nogen anmeldelser.

[Din anmeldelse](https://wordpress.org/support/plugin/gnarly-frontend-page-sorter/reviews/#new-post)

[Se alle anmeldelser](https://wordpress.org/support/plugin/gnarly-frontend-page-sorter/reviews/)

## Bidragsydere

 *   [ olie480 ](https://profiles.wordpress.org/olie480/)

## Support

Har du noget at sige? Har du brug for hjælp?

 [Vis supportforum](https://wordpress.org/support/plugin/gnarly-frontend-page-sorter/)

## Donér

Vil du gerne støtte udviklingen af dette plugin?

 [ Donér til dette plugin ](https://www.paypal.com/us/cgi-bin/webscr?cmd=_flow&SESSION=b-6EV4MS6gQ9Wgixrs6Hgv4aiG9ax1HjZjqOAX6RltwK92g5MxPQWNvHqxa&dispatch=50a222a57771920b6a3d7b606239e4d529b525e0b7e69bf0224adecfb0124e9b61f737ba21b081988ee87121ca8032a43984da2b890102b1)