Forum Replies Created

Viewing 15 replies - 1 through 15 (of 121 total)
  • Thread Starter markross67

    (@markross67)

    Thank you again! ??

    Thread Starter markross67

    (@markross67)

    More like an “educated guess”! ??

    Thread Starter markross67

    (@markross67)

    .comments-link { display: inline; }

    That worked, perfectly, bc!!! Thank you soooooo much! ??

    It is exactly how I wanted it now!

    Thread Starter markross67

    (@markross67)

    And, here is the code, currently:

    /** Custom: Custom meta information */
    
    if ( ! function_exists( 'twentytwelve_entry_meta' ) ) :
    /**
     * Set up post entry meta.
     *
     * Prints HTML with meta information for current post: categories, tags, permalink, author, and date.
     *
     *
     * @since Twenty Twelve 1.0
     */
    function twentytwelve_entry_meta() {
    	// Translators: used between list items, there is a space after the comma.
    	$categories_list = get_the_category_list( __( ', ', 'twentytwelve' ) );
    
    	// Translators: used between list items, there is a space after the comma.
    	$tag_list = get_the_tag_list( '', __( ', ', 'twentytwelve' ) );
    
    	$date = sprintf( '<a href="%1$s" title="%2$s" rel="bookmark"><time class="entry-date" datetime="%3$s">%4$s</time></a>',
    		esc_url( get_permalink() ),
    		esc_attr( get_the_time() ),
    		esc_attr( get_the_date( 'c' ) ),
    		esc_html( get_the_date() )
    	);
    
    	$author = sprintf( '<span class="author vcard"><a class="url fn n" href="%1$s" title="%2$s" rel="author">%3$s</a></span>',
    		esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
    		esc_attr( sprintf( __( 'View all posts by %s', 'twentytwelve' ), get_the_author() ) ),
    		get_the_author()
    	);
    
    	// Translators: 1 is category, 2 is tag, 3 is the date and 4 is the author's name.
    	if ( $tag_list ) {
    		$utility_text = __( 'Posted in %1$s | Tagged %2$s <span class="by-author"></span>', 'twentytwelve' );
    	} elseif ( $categories_list ) {
    		$utility_text = __( 'Posted in %1$s <span class="by-author"></span>', 'twentytwelve' );
    	} else {
    		$utility_text = __( 'Posted in %1$s | Tagged %2$s <span class="by-author"></span>', 'twentytwelve' );
    	}
    
    	printf(
    		$utility_text,
    		$categories_list,
    		$tag_list,
    		$date,
    		$author
    	);
    
    if ( comments_open() ) : ?>
       &nbsp;| <div class="comments-link">
         <?php comments_popup_link( '<span class="leave-reply">' . __( 'Leave a reply', 'twentytwelve' ) . '</span>', __( '1 Reply', 'twentytwelve' ), __( '% Replies', 'twentytwelve' ) ); ?>
       </div><!-- .comments-link -->
    <?php endif; // comments_open()
    
    }
    endif;

    I believe I did it exactly as you suggested. Please correct me if I am wrong.

    Thread Starter markross67

    (@markross67)

    Hi bcworkz,
    Thank you so much for the reply!

    The integration of the code worked just fine; however, the Leave a reply link is still showing up below the categories and tags:

    Posted in Opinion | Tagged Constitutional |
    Leave a reply

    I was hoping to have them all on the same line, as such:

    Posted in Opinion | Tagged Constitutional | Leave a reply

    Marc

    Thread Starter markross67

    (@markross67)

    ??

    Thread Starter markross67

    (@markross67)

    Thank you so much, implenton! It worked perfectly!!! ??

    Here is the final result:

    <!-- Custom: If single post... -->
    <?php if ( is_single() ) : ?>
      <h1 class="entry-title"><?php the_title(); ?></h1>
    
      <?php if ( in_category( array('Political Cartoons', 'Political Statements') ) ) : ?>
    
         <u>Posted <?php the_time('F jS, Y') ?></u>
    
      <?php elseif ( in_category( array('Scripture', 'Biblical', 'Biblical Resources', 'Quotes', 'Holidays/Anniversaries', 'Article', 'Political', 'Political Literature', 'Political Terms', 'Admin') ) ) : ?>
    
        <u>Posted by <?php the_author_posts_link(); ?> | <?php the_time('F jS, Y') ?></u>
    
      <?php else : ?>
    
        <u>Written by <?php the_author_posts_link(); ?> | <?php the_time('F jS, Y') ?> </u>
    
      <?php endif; ?>  
    
    <?php endif; // is_single() ?>
    
    <!-- Custom: If not single post... -->
    <?php if (! is_single() ) : ?>  
    
      <h1 class="entry-title">
      <a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a>
      </h1>
      <u>Posted <?php the_time('F jS, Y') ?></u>  
    
    <?php endif; // is_single() ?>
    Forum: Hacks
    In reply to: Twenty Twelve Posted Function
    Thread Starter markross67

    (@markross67)

    I think I know exactly what I need now, but I think I am going to start over with a new post.

    Forum: Hacks
    In reply to: Twenty Twelve Posted Function
    Thread Starter markross67

    (@markross67)

    Actually, that did not resolve it! ??

    That only worked for the meta data on the Home Page. I am trying to get that above code – or the Twenty Twelve similar code – to work in the single.php file.

    Forum: Hacks
    In reply to: Twenty Twelve Posted Function
    Thread Starter markross67

    (@markross67)

    I think I might have solved it myself!

    I replaced:
    twentyeleven_posted_on
    with
    twentytwelve_entry_meta

    And, using Find and Replace, I changed every instance of twentyeleven, in the above code, to twentytwelve.

    It appears to be working! ?? I may need to just do a tweak here and there.

    Forum: Hacks
    In reply to: Twenty Twelve Posted Function
    Thread Starter markross67

    (@markross67)

    My coding may not have been perfect, but it worked exactly how I wanted it to.

    Forum: Hacks
    In reply to: Twenty Twelve Posted Function
    Thread Starter markross67

    (@markross67)

    Michael,
    This is what I used in my Twenty Eleven Child Theme:

    if ( ! function_exists( 'twentyeleven_posted_on' ) ) :
    /**
     * Prints HTML with meta information for the current post-date/time and author.
     * Create your own twentyeleven_posted_on to override in a child theme
     *
     * @since Twenty Eleven 1.0
     */
    
    function twentyeleven_posted_on() {
        if ( in_category( array('Political Cartoons', 'Political Statements' ) )) {
            // Custom:
            // Note: Remove (printf) code from between quotes, to make blank; otherwise:
            // If the category is one of the above, write out Post date (ONLY).
            printf( __( '<span class="sep">Posted </span><time class="entry-date" datetime="%3$s" pubdate>%4$s</time></span>', 'twentyeleven' ),
                esc_url( get_permalink() ),
                esc_attr( get_the_time() ),
                esc_attr( get_the_date( 'c' ) ),
                esc_html( get_the_date() )
            );
        }
        elseif ( in_category( array('Scripture', 'Biblical', 'Biblical Resources', 'Quotes', 'Holidays/Anniversaries', 'Article', 'Political Literature', 'Political Terms') )) {
            // If the category is one of the above, use Posted by.
            printf( __( '<span class="sep">Posted by<span class="by-author"></span> <span class="author vcard"><a href="%5$s" title="%6$s" rel="author">%7$s</a></span><span class="sep"> | </span><time class="entry-date" datetime="%3$s" pubdate>%4$s</time></span>', 'twentyeleven' ),
                    esc_url( get_permalink() ),
                    esc_attr( get_the_time() ),
                    esc_attr( get_the_date( 'c' ) ),
                    esc_html( get_the_date() ),
                    esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
                    esc_attr( sprintf( __( 'View all posts by %s', 'twentyeleven' ), get_the_author() ) ),
                    get_the_author()
            );
    }
        else {
            // All other categories, use Written by
            printf( __( '<span class="sep">Written by<span class="by-author"></span> <span class="author vcard"><a href="%5$s" title="%6$s" rel="author">%7$s</a></span><span class="sep"> | Posted </span><time class="entry-date" datetime="%3$s" pubdate>%4$s</time></span>', 'twentyeleven' ),
                esc_url( get_permalink() ),
                esc_attr( get_the_time() ),
                esc_attr( get_the_date( 'c' ) ),
                esc_html( get_the_date() ),
                esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
                esc_attr( sprintf( __( 'View all posts by %s', 'twentyeleven' ), get_the_author() ) ),
                get_the_author()
            );
        }
    }
    endif;

    Which I would like to replicate in Twenty Twelve.

    Forum: Hacks
    In reply to: Twenty Twelve Posted Function
    Thread Starter markross67

    (@markross67)

    Oh, I just had the meta information printing out a certain way for different categories.

    Yes, I’m in the functions.php file of my Twenty Twelve Child Theme.

    Forum: Hacks
    In reply to: Twenty Twelve Posted Function
    Thread Starter markross67

    (@markross67)

    It could also be that there is a conflict in some other part of the code I am using. It worked fine in Twenty Eleven, but something may not be jiving in Twenty Twelve. I may need to recreate the entire thing.

    Forum: Hacks
    In reply to: Twenty Twelve Posted Function
    Thread Starter markross67

    (@markross67)

    Actually, I have already tried that, and it didn’t work for me. ??

Viewing 15 replies - 1 through 15 (of 121 total)