Wordpress Help

Out of context: Reply #3

  • Started
  • Last post
  • 6 Responses
  • imbecile1

    make a copy of the main index page you'll be editing. save it as the original in case you mess things up. create a page with the copy you want to display above the navigation so that it's dynamic. note the page id or slug. open your theme's template file for the homepage. find the above location in the template file where you want to display the text from the other page.

    page id:

    $page_id = QBN; // Replace QBN with the actual page ID
    $page = get_post($page_id);
    if ($page) {
    $content = apply_filters('the_content', $page->post_content);
    echo $content;
    }

    or page slug

    $page_slug = 'yo-its-qbn'; // Replace 'yo-its-qbn' with your page slug
    $page = get_page_by_path($page_slug);
    if ($page) {
    $content = apply_filters('the_content', $page->post_content);
    echo $content;
    }

View thread