Add Default Content

Community Forums Forums General Discussion Add Default Content

This topic is: resolved

This topic contains 7 replies, has 2 voices, and was last updated by  emasai 1 year, 4 months ago.

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #43526

    emasai
    Participant
    Post count: 737

    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

    • This topic was modified 1 year, 4 months ago by  emasai.
    • This topic was modified 1 year, 4 months ago by  emasai.
    #43529

    AC
    Blocked
    Post count: 7712

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

    #43532

    emasai
    Participant
    Post count: 737

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


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

    #43535

    emasai
    Participant
    Post count: 737

    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

    #43537

    AC
    Blocked
    Post count: 7712

    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.

    #43539

    emasai
    Participant
    Post count: 737

    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

    #43591

    AC
    Blocked
    Post count: 7712

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

    #43617

    emasai
    Participant
    Post count: 737

    Good, thanks for your help.


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

Viewing 8 posts - 1 through 8 (of 8 total)

The topic ‘Add Default Content’ is closed to new replies.