I think this is easy, but I'm not great at PHP. Wordpress Custom Field Password

Hi… I need some easy help. I need to fit this code:
[php]<?php the_field('password'); ?>[/php]

In the double quotes found here:

[php]$password = “password”;[/php]

This should be an easy one!

I have no idea what you are asking :slight_smile:

Alrighty, maybe this will help. I’m using php code to create a password protected page where the password is created by a custom field in wordpress. The code for the custom field is:

[php]<?php the_field('password'); ?>[/php]

The code in the password protect php code where the password goes is:

[php]$password = “password”;[/php]

I need to put the first line of code (the custom field code) in the second line where it says “password”, but when I put the custom field code in the quotations, it doesn’t recognize it as code. I am wondering if there is a way in php to echo the code in the quotations to pull the custom field into the “password”.

Does that help? :-[

Sponsor our Newsletter | Privacy Policy | Terms of Service