WordPress.org

Ready to get started?Download WordPress

Forums

Create a Page from an internal .php (7 posts)

  1. truenorth
    Member
    Posted 8 years ago #

    I've search and can't seem to find an answer to this. I've installed the Lazy Gallery plugin and it works fine. What I want to do is have a Page that displays it vs just using a link on the side bar. Here's my site: http://www.dorknuts.com. I already created the page "Artwork" with incorrect PHP code (far from my forte).
    Here's the Page template code

    <?php
    /*
    Template Name: Lazy Gallery
    */
    ?>

    <?php get_header(); ?>

    <div id="content" class="widecolumn">
    <div class="post">
    <div class="entrytext">
    <div class="styled">

    <?php include (); ?>

    </div>
    </div>
    </div>
    </div>

    <?php get_footer(); ?>

  2. Joni
    Member
    Posted 8 years ago #

    Just go to your WP Console and click Write, Page and title the page whatever you want (e.g., "Artwork"). Then leave the rest blank. You should see a dropdown box to choose the Lazy Gallery Template. Select it and save the page. Then create a link to it in your sidebar. That should do it.

  3. truenorth
    Member
    Posted 8 years ago #

    That's what I've done but I get
    Warning: main(/lazy-gallery.php): failed to open stream: No such file or directory in /homepages/43/d114412143/htdocs/wordpress/wp-content/
    themes/mx4_theme/gallery.php on line 14

    Probably due to my incorrect PHP usage (see first post)

  4. truenorth
    Member
    Posted 8 years ago #

    Well, until this is figured out, I just created a new link category and sublinks.

  5. Why is your include blank? (Not familiar with how the plugin works, but I don't see why you need to include the template file or whatever.)

    @jonimueller: if you didn't know, you don't need to leave it blank if you don't want to. For example, I usually stick The Loop into my custom page templates so that I can more easily edit any content.

  6. truenorth
    Member
    Posted 8 years ago #

    Viper -
    It was
    <?php include (lazy-gallery.php);>

    which is what gave me the error.
    Let me clarify what the plugin in does (or at least try): essentially all it does it create a "gallery" page lazy-gallery.php in the wordpress directory, that pulls pictures off a folder.

  7. neimen
    Member
    Posted 8 years ago #

    this is off the top of my head. but isn't the gallery page actually lazy-index.php?

Topic Closed

This topic has been closed to new replies.

About this Topic