Sep 13, 2013 13:30
My skype id : vinod_dalvi2
Sep 13, 2013 13:29
Bye
Sep 13, 2013 13:29
I have some urgent work
Sep 13, 2013 13:29
I should leave now
Sep 13, 2013 13:29
OR you can use get_the_ID() in get_post_meta()
Sep 13, 2013 13:29
and use the title of that page
Sep 13, 2013 13:28
Then you will have to add it on second page
Sep 13, 2013 13:27
i mean from custom field
Sep 13, 2013 13:27
and changing url from meta box
Sep 13, 2013 13:27
Sep 13, 2013 13:26
From front end?
Sep 13, 2013 13:25
then use above code
Sep 13, 2013 13:24
$page = get_page_by_title(Home');
echo get_post_meta($page->ID,'first image',true);
Sep 13, 2013 13:23
visit this url and tell me the page name
Sep 13, 2013 13:22
it's related with page
Sep 13, 2013 13:22
It's not related with custom field key
Sep 13, 2013 13:21
Slug
Sep 13, 2013 13:21
instead we should use page title or slug
Sep 13, 2013 13:20
But this is not right solution as we are using page id
Sep 13, 2013 13:20
yes
Sep 13, 2013 13:14
Yes
Sep 13, 2013 13:14
I think it should work
Sep 13, 2013 13:14
Try it
Sep 13, 2013 13:14
Use this now
Sep 13, 2013 13:14
echo get_post_meta(6,'first image',true);
Sep 13, 2013 13:11
No site url
Sep 13, 2013 13:10
Give me the url of your My First Page
Sep 13, 2013 13:10
We can try without modifying it
Sep 13, 2013 13:10
But let it be
Sep 13, 2013 13:09
"The function called by the shortcode should never produce output of any kind. Shortcode functions should return the text that is to be used to replace the shortcode. Producing the output directly will lead to unexpected results."
Sep 13, 2013 13:09
The code is not ok
Sep 13, 2013 13:08
$page = get_page_by_title('My First Page');
Sep 13, 2013 13:04
$page = get_page_by_title('My First Page');
echo get_post_meta($page->ID,'first image',true);
Sep 13, 2013 13:04
instead add whole code like this
Sep 13, 2013 13:04
echo get_post_meta($page->ID,'first image',true); ?>
Sep 13, 2013 13:04
@Nofel You have added this
Sep 13, 2013 13:03
@GM Yes but it is always unique therefore
Sep 13, 2013 12:57
Because If more that one page uses the same title, the page with the smallest ID will be returned.
Sep 13, 2013 12:56
I think this is more promising get_page_by_path('my-first-page')
Sep 13, 2013 12:53
then you should first get the id of first page
Sep 13, 2013 12:53
If you want to display meta data of first page on second page
Sep 13, 2013 12:52
I was referring to GM's point
Sep 13, 2013 12:52
Yeah i got your point
Sep 13, 2013 12:51
@Nofel What do you mean?
Sep 13, 2013 12:48
Then try what i have told you above
Sep 13, 2013 12:48
and access $post variable by global $post
Sep 13, 2013 12:48
If it does not return anything then instead of get_the_ID() use $post->ID
Sep 13, 2013 12:47
?
Sep 13, 2013 12:45
and tell me what does it echo?