2012-10-28, 03:49:15
(This post was last modified: 2013-11-26, 11:12:51 by mrdragonraaar.)
This topic is about the GetSimple Links Manager (was Link Manager 2) plugin, an easy to use plugin allowing you to manage a list of links on your website.
I have completed a complete re-write of the code to allow easier maintenance and additions (30/9/13).
Installation
Download the latest version here, unzip the downloaded file and copy its contents to your plugins folder. Please note that because of the name change, if you have an old version of Link Manager 2 you will have to remove that first to avoid a clash.
Usage
Once you've followed the directions described above, You can access the plugin via the Links tab. Click on the Add Link button to start adding new links, change the order of the links by drag & drop.
Either place php code in your theme or template or directly input placeholder tag in an edited page.
Note: The 'display' parameter from the php 'get' calls has been removed. Use 'return' calls instead.
Show all links
* PHP code
* Page placeholder
Show links from specific category
The following will show links from category id 3
* PHP code
* Page placeholder
Show category name
The following will show category name for category id 3
* PHP code
* Page placeholder
Show a single link by id
The following will show a link with id 7
* PHP code
* Page placeholder
Show a single link by name
The following will show a link named 'Fred'. This is a case-sensitive exact match.
* PHP code
* Page placeholder
Show a random link
The following will show a random link between minimum id 2 and maximum id 9. If only 1 id is used then it is assumed as a maximum with minimum 0. If no id is used then minimum is 0 and maximum is current max id.
* PHP code
* Page placeholder
Search links by keyword
The following will show links with name or description containing 'fish'. This is a case-insensitive search.
* PHP code
* Page placeholder
For example, if you use the vanilla GS Innovation theme, you could add:
somewhere between the <aside></aside> tags in the file sidebar.php to show the links from category 3 with appropriate heading in the sidebar section of your site.
There is sample css (links_manager_links.php) included with the plugin which has been tested with Innovation for styling of the links.
I have completed a complete re-write of the code to allow easier maintenance and additions (30/9/13).
Installation
Download the latest version here, unzip the downloaded file and copy its contents to your plugins folder. Please note that because of the name change, if you have an old version of Link Manager 2 you will have to remove that first to avoid a clash.
Usage
Once you've followed the directions described above, You can access the plugin via the Links tab. Click on the Add Link button to start adding new links, change the order of the links by drag & drop.
Either place php code in your theme or template or directly input placeholder tag in an edited page.
Note: The 'display' parameter from the php 'get' calls has been removed. Use 'return' calls instead.
Show all links
* PHP code
Code:
<?php $links_html = return_links(); echo $links_html; ?>
<?php get_links(); ?>
Code:
(% links %)
Show links from specific category
The following will show links from category id 3
* PHP code
Code:
<?php $links_html = return_links(3); echo $links_html; ?>
<?php get_links(3); ?>
Code:
(% links:3 %)
Show category name
The following will show category name for category id 3
* PHP code
Code:
<?php $category_name = return_category_name(3); echo $category_name; ?>
<?php get_category_name(3); ?>
Code:
(% link_category:3 %)
Show a single link by id
The following will show a link with id 7
* PHP code
Code:
<?php $link_html = return_link(7); echo $link_html; ?>
<?php get_link(7); ?>
Code:
(% link:7 %)
Show a single link by name
The following will show a link named 'Fred'. This is a case-sensitive exact match.
* PHP code
Code:
<?php $link_html = return_link('Fred'); echo $link_html; ?>
<?php get_link('Fred'); ?>
Code:
(% link:Fred %)
Show a random link
The following will show a random link between minimum id 2 and maximum id 9. If only 1 id is used then it is assumed as a maximum with minimum 0. If no id is used then minimum is 0 and maximum is current max id.
* PHP code
Code:
<?php $link_html = return_randlink(2, 9); echo $link_html; ?>
<?php get_randlink(2, 9); ?>
Code:
(% randlink:2:9 %)
Search links by keyword
The following will show links with name or description containing 'fish'. This is a case-insensitive search.
* PHP code
Code:
<?php $links_html = return_search_links('fish'); echo $links_html; ?>
<?php search_links('fish'); ?>
Code:
(% search_links:fish %)
For example, if you use the vanilla GS Innovation theme, you could add:
Code:
<div class="section linksmanager">
<h2><?php get_category_name(3); ?></h2>
<?php get_links(3); ?>
</div>
somewhere between the <aside></aside> tags in the file sidebar.php to show the links from category 3 with appropriate heading in the sidebar section of your site.
There is sample css (links_manager_links.php) included with the plugin which has been tested with Innovation for styling of the links.