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 10 months, 3 weeks ago.

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

    emasai
    Participant
    Post count: 497

    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 10 months, 3 weeks ago by  emasai.
    • This topic was modified 10 months, 3 weeks ago by  emasai.
    #43529

    anitac
    Participant
    Post count: 6489

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


    Let me help you customize your theme, responsive header, Buddypress, Agentpress or technical issue!
    Visit me here: Cre8tiveDiva.com | Tweet Me! | Plus Me!
    When asking for help, please provide a link or screen shot showing your problem!

    #43532

    emasai
    Participant
    Post count: 497

    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: 497

    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

    anitac
    Participant
    Post count: 6489

    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.


    Let me help you customize your theme, responsive header, Buddypress, Agentpress or technical issue!
    Visit me here: Cre8tiveDiva.com | Tweet Me! | Plus Me!
    When asking for help, please provide a link or screen shot showing your problem!

    #43539

    emasai
    Participant
    Post count: 497

    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

    anitac
    Participant
    Post count: 6489

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


    Let me help you customize your theme, responsive header, Buddypress, Agentpress or technical issue!
    Visit me here: Cre8tiveDiva.com | Tweet Me! | Plus Me!
    When asking for help, please provide a link or screen shot showing your problem!

    #43617

    emasai
    Participant
    Post count: 497

    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.