• Resolved pdchapin

    (@pdchapin)


    Is there any way to have a new page pre-loaded with some content? I have a user who wants a site with a lot of pages with the same type of information in the same arrangement. Basically I want to give her a fill-in format. My user if very low tech. I’ve been trying to dig into the code to find where I can do this but I’m hoping somebody has already worked this out

Viewing 2 replies - 1 through 2 (of 2 total)
  • Johnathan

    (@jelyman)

    You might find Custom Fields to your liking.

    https://codex.www.ads-software.com/Custom_Fields

    Thread Starter pdchapin

    (@pdchapin)

    While Custom Fields looks interesting, and the plugin Advanced Custom Fields even more so. I’m not sure they did what I need to do and they were clearly more complicated to set up than I wanted. I finally settled for a simple child theme with a hack to the edit-form-advanced.php file by adding

    if ($post_type == "page") {
    echo "<script type='text/javascript'>var a = document.getElementById('content');
    if (!a.innerHTML) {
    	a.innerHTML = '<p>Whatever I want to pre-load the page with</p>';
    };
    </script>";}

    right after the call to wp_editor. The first if limits me to pages and the second handles situations where I’m editing the text. It’s not elegant but it’s simple and it works.

    If I ever have a page where I don’t want the preloaded text it’s easy enough to delete it.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Pre-loading new pages’ is closed to new replies.