I'm attempting to turn users' posts into menu items, without luck.
Here's what I have so far, but not working. I would like to use the Advanced custom content by adding a shortcode.
add_shortcode( 'current-posts' , 'ss_get_current_posts' );
function ss_get_current_posts(){
global $current_user;
get_currentuserinfo();
$author_query = array('posts_per_page' => '-1','author' => $current_user->ID);
$author_posts = new WP_Query($author_query);
while ($author_posts->have_posts()) : $author_posts->the_post();
$list = '<ul class="ubermenu-submenu ubermenu-submenu-id-122-col-0 ubermenu-submenu-type-stack">';
$list .= '<a class="ubermenu-target ubermenu-target-with-icon ubermenu-item-layout-icon_left" href="';
$list .= the_permalink();
$list .= '" title="';
$list .= the_title_attribute();
$list .= '"><span class="ubermenu-target-title ubermenu-target-text">';
$list .= the_title();
$list .= '</span></a></ul>';
endwhile;
return $list;
}
I can actually see the list, but not as links inside the submenu. What is the correct way to do this?