Forums

more option possible on Pages? (8 posts)

  1. kcire
    Member
    Posted 2 years ago #

    I am busy with a gallery-website which shows paintings from a artist. The paintings are divided into years of making...2007,2008,2009 etc.

    Most pages have only a few paintings so they wil not cause the layout to grow vertically. But the page for 2009 already has about 20 images while there actually is space for only 8 images.

    If there are more images, another row, a scrollbar will appear within the content-DIV that shows the images.

    But!

    I would like to arrange it in such a way every page with 8 images gets a (easy addable for the enduser) 'see more' link...which takes a visitor to page 2 of 2009 with another 8 images.

    All this of course without ruining the menu with all kind of options like: 2009-2, 2009-3 etc. These 'extra' pages are just there on the 2009 page.

    So I thought I use the more-tag! Was I right?

    ...but of course this isn't working...

    ...is there a solution for this?

  2. esmi
    Theme Diva & Forum Moderator
    Posted 2 years ago #

    To use the <!-- more --> tag in pages you have to specifically set $more as a global variable within the the template. So immediately after the opening <?php, add global $more;.

    Step 2: move down to where you call the_content(). Just before this add $more = 0;

    <?php $more = 0;the_content(); ?>

    And that's it!

  3. kcire
    Member
    Posted 2 years ago #

    Hey Esmi,

    After which opening <?php?!?

    On the page.php? There the following is the first PHP tag:

    <?php get_header(); ?>

    should I change this to:

    <?php global $more; get_header(); ?>

    ?

  4. kcire
    Member
    Posted 2 years ago #

    I did as I stated in my previous post...there seems to appear a 'more' link...but when I click it, hoping for a next page, the whole layout is messed up and 'all' images are shown on top of it...

    What am I doing wrong?

  5. esmi
    Theme Diva & Forum Moderator
    Posted 2 years ago #

    <?php global $more;get_header(); ?>

    Sounds like there may be other issues within that theme.

  6. kcire
    Member
    Posted 2 years ago #

    I was afraid of that...

    Any suggestions on what to do?

    Is there a way to manipulate the URL is produces? Because when clicked on the 'more' link the URL ends with: /archives/#more-1 (or something similair).

    While it came from a URL ending with: archives/category/2009/

    the 'category' is gone...?!

    Thanks for all your attention by the way!

  7. esmi
    Theme Diva & Forum Moderator
    Posted 2 years ago #

    Is there a way to manipulate the URL is produces?

    Not without some serious hacking of the WP core files.

  8. kcire
    Member
    Posted 2 years ago #

    Mmhh...I will look into further...if I have found a solution I guess it's nice if I mention it here.

    Hopefully I find a solution and remember to put it up here!

    Esmi, thanks a million for all your assistance!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags