• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Add Default Content

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › General Discussion › Add Default Content

This topic is: resolved
  • This topic has 7 replies, 2 voices, and was last updated 12 years, 1 month ago by emasai.
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • June 1, 2013 at 4:58 pm #43526
    emasai
    Participant

    I am trying to add default content to a blog during development, but nothing is showing. I uploaded the default_content.php file to the theme folder and added the following to the functions file. Did I make a mistake somewhere?

    /* Show default content when it doesn't exist */
    add_action('genesis_post_content', 'defaultcontent');
    function defaultcontent() {
    global $post;
    if ( empty($post->post_content) ) {
    include(CHILD_DIR . '/default_content.php');
    }
    }


    Need Website Customization or a Responsive CSS fix? Contact Me
    Lynne emasai.com

    June 1, 2013 at 5:13 pm #43529
    AnitaC
    Keymaster

    Are you trying to add the demo content? If so, you are doing it incorrectly.


    Need help with customization or troubleshooting? Reach out to me.

    June 1, 2013 at 5:20 pm #43532
    emasai
    Participant

    Yes, can you tell me how to do it correctly please?


    Need Website Customization or a Responsive CSS fix? Contact Me
    Lynne emasai.com

    June 1, 2013 at 5:29 pm #43535
    emasai
    Participant

    Actually I just found a video about importing the xml file demo content with WP importer, but that is not exactly I want to do, because then I will have to delete it all again. The file and functions code I used I got a while back and it only shows content if there is none. But I'm no programming genius so I don't quite understand how it works when it does work.


    Need Website Customization or a Responsive CSS fix? Contact Me
    Lynne emasai.com

    June 1, 2013 at 5:35 pm #43537
    AnitaC
    Keymaster

    Well, when you import the XML file, if you import the file and leave the users just as they are - when you are ready to delete the content - you just delete the users. It will prompt you to delete their content, you say yes and that's it.


    Need help with customization or troubleshooting? Reach out to me.

    June 1, 2013 at 5:39 pm #43539
    emasai
    Participant

    OK that's good to know.

    I already have categories as my main menu is category based, so if I change the original categories but leave the users, then delete the users and their content will that also remove my categories?

    Thanks for your help.


    Need Website Customization or a Responsive CSS fix? Contact Me
    Lynne emasai.com

    June 2, 2013 at 4:53 am #43591
    AnitaC
    Keymaster

    No, categories will stay - content inside those categories will be deleted.


    Need help with customization or troubleshooting? Reach out to me.

    June 2, 2013 at 11:03 am #43617
    emasai
    Participant

    Good, thanks for your help.


    Need Website Customization or a Responsive CSS fix? Contact Me
    Lynne emasai.com

  • Author
    Posts
Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘Add Default Content’ is closed to new replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2025 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble