• room58

    (@room58)


    I am using the get_random_page() plugin to display a random page to the user, however, this only displays the content of the page. I require access to the custom (meta?) data as I dynamically change the background image of the page. How do I access the custom fields? I’ve tried.


    <style type="text/css">
    body {background: url('<?php bloginfo('stylesheet_directory'); ?>/images/<?php echo get_post_meta('$_SESSION["homepage_id"]', "css_background", TRUE); ?>') no-repeat 50% 52px;}
    </style>

    where $_SESSION[“homepage_id”] is the page ID picked randomly from the get_random_page but it’s not working (nothing returned)

    Any ideas?

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Get Random Page meta data’ is closed to new replies.