The problem is that in 99% of cases, the_*() functions will echo out the content. If you’re assigning them you would need to use get_*() functions.
In your case you’re echoing twice, once at the beginning of the link and again with the_*() function in the attribute and between the opening and closing tags. It breaks the string concatenation you have in place by echoing more than once.
Your code should look like:
echo '<a href="' . get_sub_field('website_url') . '" >' . get_sub_field('website_source') . '</a>';
Related Posts:
- WordPress Shortcode and Dynamic CSS
- Placing raw HTML inside a WordPress shortcode
- How create a Shortcode with hover and complex options
- how to changes mobile menu toggle breakpoint in WordPress
- PHP function for horizontal Woocommerce thumbnails and badges
- PHP/CSS: Shortcode won’t display correctly, and only displays in the head (before content)
- How to have Function of a plugin using global vars into a shortcode?
- Show contact 7 form in popup
- Cant get theme to change footer color through theme customizer
- Sorting Problem
- How can we upload custom page files?
- Modify previous and next text from pagination links
- Shortcode putting html such as
- Calling a method from functions.php on a click of a button
- Custom plugin issue when trying to use the shortcode twice on a page [closed]
- WordPress menu deletes when trying to add a hook
- HTML table from shortcode with multiple parameters
- Using PHP to toggle stylesheet and header image, set in cookie
- Nested shortCode functions in the functions.php file
- Making Quote Plugin more efficient
- is_page “range” for if statement?
- Add itemprop Schema.org Markup to li Elements in wp_nav_menu
- Removing unneccessary p-tags (Not every p)
- Missing sidebar parameter “fix” – before_content
- How Display Posts on category
- Plugin CSS not enqueing
- Showing content from one page on another
- How to style options page in dashboard?
- Converting HTML Template to WordPress Theme
- Populate dropdown with Child Pages based on Parent Page chosen
- Get value from shortcode to do something
- Custom shortcode outputs plain text instead of HTML at top of post
- Customize position of social icons in upme plugin [closed]
- How to Reference/Echo Variable from Another PHP Function
- Add .htm extention to a custom taxonomy
- How do I add a custom css to all posts without affecting homepage css? [closed]
- How to make modifications only to certain elements of an HTML string on the server-side?
- Display Data in Table from External Database in WP using Shortcodes
- How to make container class in PHP
- List all blogs, but exclude the main site
- Where can I find the inline-css of my theme header?
- Shortcode for Listing Users from Meta Value?
- Adding function to child theme’s function.php
- How to return a string that has a jQuery and Ajax inside in a shortcode?
- Problem with adding custom CSS class to image in ACF Photo Gallery plugin [closed]
- How to use the checked() function to check for a non-empty var
- Calling function in loop causes repeat data
- Website completely messes up when logging out
- Calling PHP Titles inside Javascript Markup
- How can I use custom menus with a Bootstrap WordPress theme?
- Link to page with posts of specific type
- Create special button on WP Tiny MCE Posts Editor for Shortcodes
- Updating Metadata with Shortcode
- Display logged in user name and lastname on page
- Create shortcode for metabox gallery
- Display Visual Composer shortcode if a post belongs in specific categories
- Add other class content with reference class value
- How to use data URL in WordPress?
- HTML comment cause issue in functions.php script root
- dynamic php menu with hidden sub-categories only showing when the category name is clicked
- couldnt show short code atts in category
- How can I prevent a shortcode div from extending beyond its boundaries?
- Remove span tags from WooCommerce Downloads page
- Display a custom name when the user has no name settle in his account
- Having trouble creating two shortcodes, one for logged in user and one for visitors
- Can’t display anything through homepage text editor
- How to find and delete a menu item in php?
- WordPress Slider is not working
- How to display post meta bellow every posts
- Display current user metadata on WordPress page
- Add Shortcode to ::before class
- Reload page with a different shortcode when a user selects from a dropdown
- Make a full-width wordpress page
- How Can I Display the Last Modified Date for User Profiles on WordPress?
- Site title not showing. Please help me
- Shortcode’s output to use as other shortcode’s parameter
- Open/closed function [closed]
- Target a specific container to style on WordPress storefront theme
- Need to Echo A Url path to show on a wordpress page
- Displaying POST content with HTML tags and all
- Can’t get_users info by using json_encode
- Highlight Single Page Ancestor
- WordPress HTML Helper
- Overwriting a Shortcode
- Trying to customize wordpress drop down categories
- Shortcoding with Divs
- How to add margin underneath woocommerce total price amount -> productpages
- Whats wrong with my code? Need To add String to shortcode? [closed]
- Integrating CSS Into a WP Function Call [closed]
- A next page function with shortcode?
- Load slideshow.css file only if Slideshow is checked / on
- Parse error: syntax error, unexpected ‘}’ in
- Is there a better way to output HTML as a shortcode?
- Custom HTML/CSS Theme into WordPress – SEO considerations
- why css file not link?how to create permalink?
- How call WordPress shortcode inside function file
- Show Login Errors In WordPress/Elementor (Code “works”, but breaks site)
- Adding a css class to the gallery
- Strip and print only the numbers found in current’s post excerpt (even if they are without space)
- Hide or Show Read More Button by Content Area