简体   繁体   中英

How to add a page_id in a php, when using childthemes?

I need to add various content, including paragraphs to a wordpress-page, for a client. I am working through Wordpress/childthemes. For some wierd reason, the page I've been handed has no entry through the page-panel in Wordpress, nor does it have a page-id through which I can identitfy, so that I can edit it through functions.php or alike - all i have is a demo page. I need to place images and paragraphs.

  <html lang="en-US" class="js"><head>
    <meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
    <link rel="pingback" href="http://danwise.democrunch.dk/xmlrpc.php">

    <script type="text/javascript">
        document.documentElement.className = 'js';
    </script>

I expect to find the page_id so that I can add HTML-content through a php-page in the childtheme

You can add the standard class names (including the page IDs) by using WordPress's body_class() function. It would look like this:

<body <?php body_class(); ?>>

And output something like this:

<body class="page page-id-2 page-parent page-template-default logged-in">

You can read more about this in the WordPress docs .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM