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?
- How to manually fix the WordPress gallery code using PHP in functions.php?
- How do I change/modify the_post_thumbnail(); html output?
- start_lvl Ignored in Custom walker_nav_menu
- Modify previous and next text from pagination links
- How do I use Shortcodes inside of HTML tags?
- Shortcode putting html such as
- Counting number of posts in a category and its sub categories and displaying result using shortcode
- Calling a method from functions.php on a click of a button
- Shortcode created to check language not works
- Best way of adding CSS which can be manipulated by the user via theme option panels?
- Multiple pages on one with different HTML
- Add/echo div with Analytics-Code to function in functions.php
- Custom plugin issue when trying to use the shortcode twice on a page [closed]
- How can I default to all WordPress roles when parameter is not included in shortcode?
- WordPress menu deletes when trying to add a hook
- HTML table from shortcode with multiple parameters
- Minify HTML, CSS, JS with PHPWee?
- Wrap each shortcode in array to div
- Using PHP to toggle stylesheet and header image, set in cookie
- How to display a value from a radio button in the options menu in wordpress
- Recent post display using shortcode
- Nested shortCode functions in the functions.php file
- Making Quote Plugin more efficient
- Slide in Panel WordPress Post
- is_page “range” for if statement?
- An unwanted inline style is added to my body tag
- Show post in slider
- PHP code inside shortcodes
- Add itemprop Schema.org Markup to li Elements in wp_nav_menu
- Removing unneccessary p-tags (Not every p)
- How can I hide Home in my menu in a specific page?
- Shortcode content filter?
- Missing sidebar parameter “fix” – before_content
- How Display Posts on category
- Trigger popup in a php if/else statement
- Add a class to the anchor tag on HTML5 gallery
- Plugin CSS not enqueing
- Hide Hamburger Menu On Specific Page (Front Page/Home Page)
- how to remove metadata from the posts of my blog?
- How to output a PHP file values by shortcode?
- Showing content from one page on another
- How to style options page in dashboard?
- Where in PHP do I move title and meta (date) to bottom of each blog section?
- Converting HTML Template to WordPress Theme
- How to display posts by current user in a drop down
- Populate dropdown with Child Pages based on Parent Page chosen
- How to store data from multiple forms using ajax and php
- Get value from shortcode to do something
- Use DOMDocument with ob_start breaks my HTML code
- Custom shortcode outputs plain text instead of HTML at top of post
- Pass php dynamic variable to shortcode
- Customize position of social icons in upme plugin [closed]
- Css loads very slow [closed]
- Different post styles depending on category
- WordPress Multiple Navigation bars
- How to Reference/Echo Variable from Another PHP Function
- Remove echo from shortcode
- Add .htm extention to a custom taxonomy
- Auto 301 to full post permalink? (using : /archive/%post_id% to %post_name% )
- responsive.css in the WordPress should be prioritized
- How do I add a custom css to all posts without affecting homepage css? [closed]
- Redirect to another page using contact form 7? [closed]
- Noscript not working as it should in wordpress site
- Shortcode with PHP issue “Undefined index”
- height should be set to auto to avoid pixelation in the post thumbnail function
- How to make modifications only to certain elements of an HTML string on the server-side?
- Wrapping a Sidebar within
- Shortcode from a function not working
- Add Codepen animation as Preloader to WordPress
- Display Data in Table from External Database in WP using Shortcodes
- Is it possible to return content, and then also continue to do other things?
- Widget back end radio button issue
- ::before on open/close function [closed]
- How to make container class in PHP
- Is it possible to define variables in a wordpress shortcode, and then call the shortcode using a specific variable?
- Creating WordPress Shortcode with Variable
- Shortcode to find and replace URL
- Creating a mobile site by adding a new class to the body tag from functions.php
- Help with WordPress function inside a shortcode
- calling a custom field value inside functions.php
- Calling a function via a shortcode in javascript
- 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)
- Woocomerce custom add to cart button edit functionality [closed]
- How do I make a shortcode to display Dokan seller badge list?
- Editing stylehseet url in head section of WordPress
- separating column the variations from the add to cart button woocommerce
- Calling a PHP function from a menu item
- Removing website URL in comments causes misalignment of submit button and tickbox