• Hey guys…
    I’m working on adding a custom single.php to my theme.

    Here is what I’m hoping to achieve.

    I have single.php -> It works as expected and all is OK.

    I’ve created a modified single.php file (named gallery.php)
    This file will generate a picture gallery based on information stored into a custom field in each post (I’d like to store the html for the gallery thumbnails in the custom field)

    And now two questions:
    1. About the custom field -> What is the data limitation for the custome field? How many bits can it hold within mySQL? I ask because I don’t want to start coding stuff to then find out that the field can’t hold the desired number of characters.

    2. About the index.php in my theme.
    Lets take the default theme for WP.

    This is the loop in the index.php

    [code]
    <?php if (have_posts()) : ?>

    <?php while (have_posts()) : the_post(); ?>

    <div <?php post_class() ?> id="post-<?php the_ID(); ?>">
    <h2>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></h2>
    <small><?php the_time('F jS, Y') ?> <!-- by <?php the_author() ?> --></small>

    <div class="entry">
    <?php the_content('Read the rest of this entry »'); ?>
    </div>

    <p class="postmetadata"><?php the_tags('Tags: ', ', ', '
    '); ?> Posted in <?php the_category(', ') ?> | <?php edit_post_link('Edit', '', ' | '); ?> <?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?></p>
    </div>

    <?php endwhile; ?>
    [/code]

    As we all know the the_permalink() tag will pull the url to a particular post, and the page that this url points to is controlled by single.php

    My question: Is there a way where I could have a second link in the loop… pointing to a page controlled to the gallery.php file?

    I hope I’m making this understandable

    Thanks
    Sebastian

Viewing 1 replies (of 1 total)
  • “Sorry, i haven’t tried this before” ™,
    but “i would try the following” ™:

    – analyze custom field;
    include() needed template…

    I’m not sure this will work though…

    Well… may be this is not what you’ve asked, sorry 🙂

Viewing 1 replies (of 1 total)
  • The topic ‘Adding a secont single.php to my theme.’ is closed to new replies.