Shortcodes Work, but do not include chosen Target
-
I am using the short code code you posted on another thread an it works well, but it does not grab what is chosen in the Target area of the Link settings. What can I do to add this?
<?php /* * WordPress Shortcode * Install : Drop in your functions.php, or create a simple plugin (and drop all your functions there) * Description : Displays the blogroll of a site * Dependencies : Can be used with My-Link-Order plugin, or without it * Usage : write the shortcode in any post/page [myblogroll] * : to display only one category use this [myblogroll catslug="blogroll"] */ function printLinks( $atts, $content = null ) { extract( shortcode_atts( array( 'catslug' => '' ), $atts ) ); $ritorna = ""; $taxonomy = 'link_category'; if (!function_exists('mylinkorder_get_bookmarks')) { $args = array('orderby'=>'name','slug'=>$catslug); } else { $args = array('orderby'=>'order','slug'=>$catslug); } $terms = get_terms( $taxonomy, $args ); if ($terms) { foreach($terms as $term) { if ($term->count > 0 && $term->slug!='uncategorized') { $ritorna .= "<br /><h3>".$term->name."</h3>"; if (!function_exists('mylinkorder_get_bookmarks')) { $bookmarks = get_bookmarks( array( 'orderby' => 'name', 'order' => 'ASC', 'category_name' => $term->name )); } else { $bookmarks = mylinkorder_get_bookmarks( array( 'orderby' => 'order', 'category_name' => $term->name )); } foreach ( $bookmarks as $bm ) { $ritorna .= sprintf( '<a class="relatedlink" href="%s">%s</a><br />', $bm->link_url, __($bm->link_name) ); } } } } return $ritorna; } add_shortcode('myblogroll', 'printLinks'); ?>
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Shortcodes Work, but do not include chosen Target’ is closed to new replies.