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 to manually fix the WordPress gallery code using PHP in functions.php?
- 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
- Get value from shortcode to do something
- 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
- Auto 301 to full post permalink? (using : /archive/%post_id% to %post_name% )
- How do I add a custom css to all posts without affecting homepage css? [closed]
- Noscript not working as it should in wordpress site
- Shortcode with PHP issue “Undefined index”
- How to make modifications only to certain elements of an HTML string on the server-side?
- Wrapping a Sidebar within
- Display Data in Table from External Database in WP using Shortcodes
- ::before on open/close function [closed]
- How to make container class in PHP
- Creating a mobile site by adding a new class to the body tag from functions.php
- calling a custom field value inside functions.php
- List all blogs, but exclude the main site
- Cant display an image via PHP in wordpress
- 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
- Link to page with posts of specific type
- Create special button on WP Tiny MCE Posts Editor for Shortcodes
- Displaying images outside the content
- Updating Metadata with Shortcode
- WordPress User Meta value variable into Google Gauge Chart
- Display logged in user name and lastname on page
- Create shortcode for metabox gallery
- Add other class content with reference class value
- 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
- Remove span tags from WooCommerce Downloads page
- Drop down question
- 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?
- How can I edit the final HTML structure of the whole web page
- WordPress Slider is not working
- How to display post meta bellow every posts
- how to add functions to my function.php using a child theme?
- 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
- 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
- Add class for the_post_thumbnail_caption()
- 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
- How to include different html tags in the header for different pages?
- Displaying POST content with HTML tags and all
- Can’t get_users info by using json_encode
- Wrapping shortcode content in a span or link
- Font-Family does not looks like how it should be [closed]
- WordPress HTML Helper
- WordPress – Image href for home menu nav not working
- Overwriting a Shortcode
- How to add margin underneath woocommerce total price amount -> productpages
- Whats wrong with my code? Need To add String to shortcode? [closed]
- How do I get Roboto Google Font to display normal font-style? [closed]
- A next page function with shortcode?
- Load slideshow.css file only if Slideshow is checked / on
- Parse error: syntax error, unexpected ‘}’ in
- Display terms on product page with shotrcode
- Custom HTML/CSS Theme into WordPress – SEO considerations
- ‘This Field is Required.’ is Not Displaying on CF7 [closed]
- why css file not link?how to create permalink?
- Show Login Errors In WordPress/Elementor (Code “works”, but breaks site)