Topic: How to use meta on tapestries.php

I am using "PER LINE" settings on my theme arras option to display in categories.
Now I want to add meta on "PER LINE", but how?

I have written a custom field key on my post named "title" and value of some title (whatever).

Now i need to call the meta in "PER LINE" (tapestries.php), so i use this code


<?php if ( get_post_meta($post->ID, 'title', true) ) : ?>
<?php echo get_post_meta($post->ID, 'title', true) ?>
<?php endif; ?>

as stated in wordpress codex ( http://codex.wordpress.org/Function_Ref … _post_meta )

but when i tried to put it in that code in the tapestries.php it doesn't work. The "PER LINE" in tapestries.php code should look like this.

/**
 * Per Line tapestry callback function.
 * @since 1.4.3
 */
if (!function_exists('arras_tapestry_line')) {
    function arras_tapestry_line($dep = '', $taxonomy) {
        ?>

        <a rel="bookmark" href="<?php the_permalink() ?>" title="<?php printf( __('%s', 'arras'), get_the_title() ) ?>"><li <?php arras_post_class() ?>>

            <h3 class="entry-title"><?php the_title() ?></h3>
            <p class="entry-comments"><?php comments_number() ?></p>
        </li></a>
        <?php
    }
    arras_add_tapestry( 'line', __('Per Line', 'arras'), 'arras_tapestry_line', array(
        'before' => '<ul class="hfeed posts-line clearfix">',
        'after' => '</ul><!-- .posts-line -->'
    ) );
}

I'm thinking tapestries.php is outside the loop? or am i using the wrong meta code? I'm not sure. I'm not a php guy that much, i just understand some basics of it.

Thank for any help.

Last edited by s2pidkaspr (2012-01-13 23:52:51)

Thumbs up

Re: How to use meta on tapestries.php

any ideas anyone? =/
still in need of this function to work..

Thumbs up

Re: How to use meta on tapestries.php

s2pidkaspr wrote:

any ideas anyone? =/
still in need of this function to work..

Where are you adding the get_post_meta() code? I don't see in the tapestry.

The tapestry function is technically inside the loop. It get's called once per articles returned by the query.

Thumbs up