Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

lost in the_field

Featured Replies

hello all wondered if you could help me figue out why the code below isn't working?

I have 'buy_now' set up as a Custom Field in Wordpress.

 

<p><b>FIND OUT MORE </b><a href="<?php the_field('buy_online'); ?>" TARGET="_blank">HERE</a></p>

 

apologies if this is in the wrong forum section

cheers for any help

eighty0ne

I dont know anything about wordpress but maybe that function only returns a value, so you have to echo it out.

 

<p><b>FIND OUT MORE </b><a href="<?php echo the_field('buy_online'); ?>" TARGET="_blank">HERE</a></p>

  • Author

thanks Jock - just tried that but no luck sadly

it just seems to want to create a link to the current page

here is one of the pages in question

 

the full code for that section runs

 

<p><?php the_field('in_a_nutshell'); ?></p>
<p><?php the_field('materials'); ?></p>
<p><?php the_field('price'); ?></p>
<p><?php the_field('in_their_words'); ?></p>
<p><b>FIND OUT MORE </b><a href="<?php echo the_field('buy_online'); ?>" TARGET="_blank">HERE</a></p>

 

weird - anyone else any ideas?

cheers

Er, the OP has just said that echoing out the function result didn't work. A shorthand way of echoing out a statement won't suddenly make it work lol.

 

@OP: does the field "buy_online" actually exist? I'd say no if other calls to the get_field function work as expected.

 

:crazy:

Edited by webdesigner93

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.