PHPackages                             ekandreas/listig - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. ekandreas/listig

ActiveWordpress-plugin

ekandreas/listig
================

List Manager as a WordPress plugin

0.2.6(9y ago)424MITVuePHP ^7.0

Since Feb 5Pushed 7y ago2 watchersCompare

[ Source](https://github.com/ekandreas/listig)[ Packagist](https://packagist.org/packages/ekandreas/listig)[ Docs](https://www.elseif.se)[ RSS](/packages/ekandreas-listig/feed)WikiDiscussions develop Synced 2mo ago

READMEChangelogDependenciesVersions (35)Used By (0)

Listig
======

[](#listig)

Another List Manager in WordPress. Editorial plugin to manage custom post lists.

The plugin is published at the official [WordPress plugin repository](https://wordpress.org/plugins/listig/) for download.

WORK IN PROGRESS 2018/2019
--------------------------

[](#work-in-progress-20182019)

Dockerize development and going towards Gutenberg

Docker capsuled script file
---------------------------

[](#docker-capsuled-script-file)

`./docker/develop` is a "docker-compose" capsuled command with added extensions for this develop environment.

Docker setup, step by step
--------------------------

[](#docker-setup-step-by-step)

1. Clone the repo to a dev folder
2. Build the dockerfiles via the develop script, eg: `./docker/develop build`
3. Start your containers, eg: `./docker/develop up -d`
4. Run the script file with the init command to create a running container environment, eg: `./docker/develop init`

If you want to run wp-cli commands in the container, eg: `./docker/develop wp help`

Login to WordPress via `http://localhost/wp/wp-admin` with username `admin` and password `admin`.

Frontend
--------

[](#frontend)

Listig uses laravel-mix as a webpack wrapper.

Start with `yarn` to get all dependencies. Then `yarn run watch` for continuous dev compile. Read more at

Note! The dist files is checked into the repo!

---

**DEPRECATED**

--old-- Work In Progress
------------------------

[](#--old---work-in-progress)

This is a plugin in beta phase. A lot of work in progress. As development environment we use another repo at [Github](https://github.com/ekandreas/listig.app).

Requirements
------------

[](#requirements)

- PHP ^7.0
- WordPress ^4.7

Usage with shortcodes
---------------------

[](#usage-with-shortcodes)

You can render your list with the following shortcodes:

- `[listig]`, takes all its content and repeats it for every post item in your list.
- `[listig-headline]`, shows the current post items headline.
- `[listig-excerpt]`, shows the current post items text.
- `[listig-url]`, gives the url to the post item edited. Takes one argument `target`, eg: `[listig-url target="_blank"]` will render a hyperlink that opens in a new tab.
- `[listig-image]`, renders an image from the post item. You have the same arguments as to wp\_get\_attachment\_image. Eg: `[listig-image size="medium"]` will render an image with the defined medium size.

Here is an example from a post content to render a complete list with id=236:

```
[listig id="236"]

[listig-headline]

[listig-image]

[listig-excerpt]

[listig-url]Read more![/listig-url]

[/listig]

```

Then you can format the shortcodes, eg set the headline to H2 and the read more link to italic.

[![shortcode example](https://raw.githubusercontent.com/ekandreas/listig/master/assets/img/example-page-with-shortcodes.png "Shortcode example page with Twenty Seventeen")](https://raw.githubusercontent.com/ekandreas/listig/master/assets/img/example-page-with-shortcodes.png)

Usage in templates
------------------

[](#usage-in-templates)

The global function `listig` accepts the ID of the list you want to loop. The ID is printed in the list settings (the gear icon).

`listig` returns an array with posts of properties; headline, excerpt, imageId and imageUrl.

A simple example to render the output from a list:

```
$posts = listig(236);
foreach ($posts as $post) {
    ?>
