Forum Replies Created

Viewing 10 replies - 1 through 10 (of 10 total)
  • Thread Starter tjalling474

    (@tjalling474)

    yeah, you’re right ??
    the letters were being displayed twice,
    that’s why edited de code to:
    echo '<a name="' . $curr_letter . '"></a>';
    that way it works fine.

    thanks for all the help! ??

    Thread Starter tjalling474

    (@tjalling474)

    Thanks! It’s working now ??

    Thread Starter tjalling474

    (@tjalling474)

    Okay, well I it is finally up and running.
    The only thing left is to add the anchors.
    So these: <a name="A">A</a>
    How should I insert this in the code:

    <?php
             $posts = (get_query_var('posts')) ? get_query_var('posts') : 1;
             $args = array (
                'posts_per_page' => $posts_per_page,
                'post_type' => 'post',
                'orderby' => 'title',
                'order' => 'ASC',
                'post' => $post
             );
             query_posts($args);
             if ( have_posts() ) {
                $in_this_row = 0;
                while ( have_posts() ) {
                   the_post();
                   $first_letter = strtoupper(substr(apply_filters('the_title',$post->post_title),0,1));
                   if ($first_letter != $curr_letter) {
                      if (++$post_count > 1) {
                         end_prev_letter();
                      }
                      start_new_letter($first_letter);
                      $curr_letter = $first_letter;
                   }
                   if (++$in_this_row > $posts_per_row) {
                      end_prev_row();
                      start_new_row();
                      ++$in_this_row;  // Account for this first post
                   } ?>
                   <div class="title-cell"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></div>
                <?php }
                end_prev_letter();
                ?>

    I really appreciate the help. ??

    Thread Starter tjalling474

    (@tjalling474)

    Hey, I made a custom page template, put the code in it and edited so it follows my theme’s structure. If also put the functions in my functions.php. But when I want to view a page which uses this template I get the following error:
    Parse error: syntax error, unexpected T_VARIABLE, expecting ‘)’ in /home/animesum/public_html/wp-content/themes/arras/A-Z Pagestest.php on line 39

    On line 39 there is this: $in_this_row = 0;
    There is a function that Ive put in my functions.php:

    function start_new_row() {
    global $in_this_row;
    $in_this_row = 0;
    echo "\t<div class='row-cells'>\n";
    }

    So I don’t understand why I got the error. 0_o

    Thread Starter tjalling474

    (@tjalling474)

    Thanks for the reply, looks like I can use that ??
    But were should I put that code..?

    Thread Starter tjalling474

    (@tjalling474)

    It works =D

    Thread Starter tjalling474

    (@tjalling474)

    I used the first shortcode that you gave me:

    function tags_in_post($atts) {    // [tags] outputs post's tags in a span
    global $post;
    $tags = '<span class="post-tags">';
    ob_start();
    the_tags( '<span class="post-tags"><strong>Tags:</strong> ', ', ', '</span>' );
    $tags = ob_get_flush();
    return $tags;
    }
    add_shortcode ('tags', 'tags_in_post');

    and I deleted the Tags: in this partthe_tags( '<span class="post-tags"><strong>Tags:</strong> ', ', ',
    otherwise you get Genres: Tags: ….

    There is only a problem now. The tags do not only show after Genres: but also at the beginning of my post like this:

    Test
    (EDIT POST)
    POSTED IN: ANIME SUMMARIES
    Action, Comedy <<<<<<<<<
    Information

    Genres: Action, Comedy
    Rating: (No Ratings Yet)

    Does anyone know a solution?

    Thread Starter tjalling474

    (@tjalling474)

    Thanks a lot. It works perfect now! =D

    Thread Starter tjalling474

    (@tjalling474)

    Thanks a lot ??
    That will do the trick. But in which file should I put:

    function tags_in_post($atts) {    // [tags] outputs post's tags in a span
    global $post;
    $tags = '<span class="post-tags">';
    ob_start();
    the_tags( '<span class="post-tags"><strong>Tags:</strong> ', ', ', '</span>' );
    $tags = ob_get_flush();
    return $tags;
    }
    add_shortcode ('tags', 'tags_in_post');

    or

    function dtags_func($atts) {
        extract(shortcode_atts(array(
    		'before' => '',
    		'separator' => ', ',
            'after' => '',
    	), $atts));
    
    	the_tags($before,$separator,$after);
    }
    add_shortcode('dtags', 'dtags_func');

    In single.php?

    Thread Starter tjalling474

    (@tjalling474)

    Thanks, It works now ??
    Can I also put a small image next to the results?

Viewing 10 replies - 1 through 10 (of 10 total)