Get given or global post


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1.  
  2. // Hämtar den globala posten eller angiven.
  3. function get_given_or_global_post($post_id){
  4. global $post;
  5.  
  6. if(is_null($post_id) || $post_id == 0)
  7. return $post;
  8. else
  9. return get_post($post_id);
  10.  
  11. }
  12.  

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.