Created
June 23, 2012 18:24
-
-
Save Abban/2979326 to your computer and use it in GitHub Desktop.
WP - Meta links list
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* The Reference Links | |
* | |
* Outputs a refrence links list from post meta. | |
* | |
* @return string | |
*/ | |
if(!function_exists('the_refrence_links')){ | |
function the_refrence_links(){ | |
$link_string = get_post_meta($post->ID, 'linkslist', true); | |
$links_array = explode(',', $link_string); | |
$output = '<ul>'; | |
foreach($links_array as $link): | |
$output ,= '<li><a href="' .$link .'">' .$link .'</a></li>'; | |
endforeach; | |
$output .= '</ul>'; | |
echo $output; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment