Quantcast
Channel: WordPress.org Forums » All Topics
Viewing all articles
Browse latest Browse all 59525

Custom Fields to variable in PHP

$
0
0

Replies: 0

Hi, All

I have a question regarding the custom fields function when creating a Page.

I have created a custom template page.

This cointains:

<?php /* Template Name: Digital_Log */
get_header(); ?>
	<html>
		<iframe src="/logbook/log.php" width="100%" height="6500" style="border:none" scrolling="no";></iframe>
	</html>
<?php get_footer(); ?>

This works, I get the header, footer and the redirected page in the middle of it.

Now I want to create a Custom Field named: “url-name”
The value of the field is: “/logbook/log.php”

I want to pass this to a variable in to the custom template file in PHP.

I have tried this example:
<?php $key="mykey"; echo get_post_meta($post->ID, $key, true); ?>
Where $key = “url-name”

But I get nothing.

Any Advice would be apreciated.

Bjorn

  • This topic was modified 32 minutes ago by erazotropa.

Viewing all articles
Browse latest Browse all 59525

Trending Articles