• Resolved mcederberg

    (@mcederberg)


    Hello,

    I have a static homepage on my site and am trying show the following content on this page only:

    1. The content of a static page (“About”)
    2. An include in my site (running some custom code)

    Can someone help me with this? Many thanks in advance!

Viewing 4 replies - 1 through 4 (of 4 total)
  • 1. Go to WordPress Admin > Settings > Reading

    2. Select ‘A static page’ under ‘Front Page Displays’

    3. Select ‘About’ page from the dropdown box next to ‘Front Page:’

    4. You are done!

    5. Will you be able to explain a little bit more on the 2nd requirment. i.e. what did you mean by ‘an include in my site’?

    Thread Starter mcederberg

    (@mcederberg)

    Thank you! So I have my static front page setup and functional, but I need to include other static pages on it – if that makes sense.

    For the include, I have some dynamic content currently in php file that I want to run only on certain pages. Can I do this? This is what I meant by “include”

    Thank you!

    1. Make a new template file in theme directory.

    /wp-content/themes/your-theme-folder/

    1.1 Duplicate single.php file or relavant template file used to display the about page.

    Learn more about templates: http://codex.wordpress.org/Templates

    1.2 Add “Template Name: Custom Template” as a comment in the beginning of new file, making it a new template file.

    /**
     * Template Name: Custom Template
     */

    1.3 Add your custom php code file using require 'your-file.php' at the correct line of your new template.

    2. Edit the about page visiting WordPress Admin > Pages

    2.1 Change “About” page template from ‘default’ to ‘Custom Template’

    2.2 About page now displays the custom code output.

    Thread Starter mcederberg

    (@mcederberg)

    This worked great, thanks a lot!!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Show multiple static page content on homepage only’ is closed to new replies.