• Hello, I’ve inherited a WordPress site, where all the widgets were turned off and cannot be turned on. So I’m dealing with PHP. There is a php function in my my front page template called get_post_meta, and the first parameter is 4. I gather that 4 refers to the ID of the post from which the content is being used. Problem is that I’ve looked everywhere and no such post with an id of 4 exists. Can this be hidden somehow? Is there a way to find it? I’m not PHP savvy and kind of new to WordPress.

    Thanks.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Try searching the Codex before posting.

    http://codex.ww.wp.xz.cn/Function_Reference/get_post_meta

    Thread Starter gregory.ledger

    (@gregoryledger)

    I don’t think you understood the question, esmi. I already read that codex page.

    the code is:

    <?php
                        $ID = 4;
                        echo get_post_meta($ID, 'caption_text', true);
                        ?></div>
                                    <div class="whitearergt"><?php
                                        $ID = 4;
                                        echo get_post_meta($ID, 'contact_usbody', true);
                        ?></div>

    My issue is that there is no post with an id of 4 (there is a post with an id of 1, then the next post in number order is 31. So I’m asking how did the programmer reference a post with an id of 4 and how do I find it?

    I have absolutely no idea why the original developer use an id of 4 or what else in the theme’s code may be a factor. Sorry.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘get_post_meta post id question’ is closed to new replies.