the_permalink(), the_title() by default echo their value. As you want to store that value in a variable you will need to return the values instead.
get_the_permalink(), get_the_title() are two similar functions that return the value instead of echo.
So you new code may look something like this:
$list="<li 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 .= get_the_permalink();
$list .= '" title="';
$list .= get_the_title();
$list .= '"><span class="ubermenu-target-title ubermenu-target-text">';
$list .= get_the_title();
$list .= '</span></a></li>';
Related Posts:
- Undefined Function Fatal Error with Shortcode [closed]
- Update post counts (published, draft, unattached) in admin interface
- WordPress removing tags?
- WordPress: How to get the current logged in author page URL?
- disable password protected page for logged users
- Update all posts automatically when using post_meta
- Search & Remove Specific Shortcode From All Posts
- Force “Submit to review” when a post is updated
- Shortcode Not displayed at the Right Place [duplicate]
- Automatically added brs and paragraphs?
- Overview with latest edited posts and pages
- Specific loop in Shortcode
- Navigation link to specific user page
- Get how many days since last post of the current user
- Hide comments awaiting moderation from user who submitted the comments
- How to add shortcode tags in single.php [closed]
- Query All users that has post
- Adding variable for post title so post template can include auto-generated link to view on external website.com/{post title}
- How to create shortcode to show the 2 latest posts
- Limit number of posts a user can make per minute?
- How do I allow users to follow a post and then allow admins to email all users who have followed that post?
- Allow anonymous users to post to my site for moderation
- Remove Shortcode […] from Blog Preview
- how to find user ids of all commenters in a post
- Display a post by ID attribute with shortcode
- count the total number of comments the user has received for his published posts
- do_shortcode within post query
- How to allow logged in users to post anonymously
- How to get rid of shortcodes in post content once and for all
- How can i display gallery shortcode output under Post text
- How to verify wp user password by sql query in wp? [closed]
- How can i delay reading posing in 3days for not logined user?
- Encountering “Wrong nonce. Action prohibitied.” when trying to alter User Role and unable to Post via WP Admin
- What’s the best way to render Visual Composer in posts, not pages?
- display-posts shortcode attributes have no effect
- Shortcode and whitespace formatting problem
- Shortcode to display the latest news article within a page
- Shortcodes on my website stops working after theme update [closed]
- How to get ID of the page included with get_page()?
- Assign published posts to another user automatically
- Add field to user meta table in database when link is clicked
- Hide comments and posts posted by other user
- Summary of Posts by an User
- Shortcode with ‘year’ parameter
- Display a list of users who have viewed the post you are viewing
- How come a YouTube link isn’t transformed into a shortcode inside the post content?
- Is it possible to add a shortcode below post title?
- Check if current user has a post and that post has any term/s from a specific custom taxonomy outside the loop
- Echo Text If User Is Logged in But NOT the Author of post
- WordPress 302 Redirect to Random Product/Post/Page
- Deleted a user with administrator rights. Now all the data/content/images are lost. how to recover them back
- How to convert query sql to shortcode in wordpress?
- How can I add 2 buttons with shortcode
- Retrieve data from post meta meta_key having ‘_product_fq_image’ while having author_id and post type is PRODUCT
- Cannot select certain authors for posts after import
- Shortcode for tables which can include comma and linebreaks
- post/page content
- Change published date and time using SQL query for page in every 5 hour
- get category in list of posts // shortcode for custom related posts
- shortcode // get posts by ids
- Display “no post” message
- Featured Story Shortcode not outputting content
- Function is printing twice – any suggestions?
- Contact Form 7 Shortcode not recognized inside another shortcode
- Display Post from Custom Post Type with Shortcode
- wp_insert_post() Add and specific ID to the body of that
- How can get the last post date of the user?
- Add a url parameter to the current post and read it in a shortcode
- WordPress Delete Users from backend doesn’t work
- Allow users to post their videos to my wordpress website?
- Secretly passing post ID/title etc into a shortcode form automatically to link submission to post
- I need show posts by customer (Shortcode)
- Is it possible to query a category with specified posts?
- Shortcode: How to add custom posts?
- Add new post only in assigned category
- WordPress each user has each content for a page,how to do that?
- User rank in wordpress post
- Count how many posts a user has viewed
- Shortcode for printing post titles
- Allow users to create their own page/s
- Get current user array with post string
- How to use extract shortcode in loop?
- Using Post ID and Page ID in same function
- Show Custom Post From Logged In Author
- Display only posts with comments
- Delete old post with new post
- How to handle dates, trying to calculate time since a post
- The post order is different for logged-in and non-logged-in users? [closed]
- How do I add an article to specific page?
- get value from post to sidebar
- WordPress Yoast SEO plugin Post Save/Update Issue
- Insert Shortcode exactly at the end of the content
- Trying to create shortcode listing custom posts, but formating not being included
- Simple shortcode to check if a user has commented on a certain post
- Automatically select category based on user role
- How to use shortcode to get the second to newest post?
- How to allow Contributors to edit their own posts, whilst still needing to be reviewed by an admin?
- Allow users to edit post without logging in
- How can I strip a single tag from an email post
- How do you export and import wordpress blog posts and exclude pagebuilder shortcodes?