if you describe what you are trying to achieve, someone might be able to comment.
what it looks like:
– you are getting the value of a custom field;
what is supposed to be in this custom field?
– you are trying to put this vaslue through ‘the_content()’ function;
this would set the ‘read more’ text, if anything at all;
what are the results?
have you tried to study the codex on the functions that you are using?
http://codex.wordpress.org/Function_Reference/the_content
http://codex.wordpress.org/Function_Reference/get_post_meta
maybe these can help you to get the content of a post by id:
http://codex.wordpress.org/Function_Reference/get_post
or
http://codex.wordpress.org/Template_Tags/get_posts
Thread Starter
m3tsys
(@m3tsys)
In the custom field it is the id of the post i want to display the content of.
i don’t know why but this code works:
<?php $review = get_post_meta($post->ID, 'id-review', true); $permalink = get_permalink( $review ); echo $permalink; ?>
* where id-review
is the id of the post
This code displays the link to the post that i’ve saved the id in the custom field
Can you help me?
I hope now you understand what i want to do…
have you investigated: get_post()
$postsubtitrare = get_post_meta($post->ID, 'id-subtitrare', true);
$post_subtitrare = get_post($postsubtitrare);
$content = $post_subtitrare-> post_content; echo $content;
try this once.
example:
<?php $review = get_post_meta($post->ID, 'id-review', true);
$thispost = get_post( $review );
$content = $thispost->post_content;
echo $content; ?>
http://codex.wordpress.org/Database_Description#Table:_wp_posts
Thread Starter
m3tsys
(@m3tsys)
Thank you very much! You saved me.