• Resolved Alissa_WP

    (@alissa_wp)


    Hi !

    I’d like to change two little things :
    ->In the ligne date of the post/author/comments I want to remove author.
    -> I’d like to put this line not under the title but at the end of the post.
    ->And, I’d like to remove definitively the group’s name that appears before the title.

    How can I do that ?

    (PS : sorry for my english, i’m French but most importantly : thank you for your amazing theme !!)

Viewing 6 replies - 1 through 6 (of 6 total)
  • Theme Author ThemeAWESOME

    (@tsquez)

    Hey there, you are very welcome and I am glad you have chosen to use WP-Forge. Please rate it when you get a chance 😉

    This explanation is going to be a little involved but super easy to do. We will doing what is a called deregistering functions and writing our own. I hope you are using a child theme.

    I do apologize but I do not have the time this moment and I also have no access to the theme files as I am at work but when I get home later I will gladly explain what needs to be done.

    Again sorry for the wait.

    Theme Author ThemeAWESOME

    (@tsquez)

    Again sorry for the wait. As I stated previously I hope you are using a child theme. Let’s see what we can do here. OK so you want to remove the “group” name before the title. Simple enough.

    First copy content.php into your child theme folder. Then open up content.php. Now look for line 13. It should look like this <?php wpforge_entry_meta_categories(); ?> – This is what is responsible for showing the group above the title. Do not delte it, just comment it out, like this
    <?php// wpforge_entry_meta_categories(); ?> – Now the group will no longer appear above the title.

    If you are not using a child theme (ahhhh gasp gasp) then all you have to do is open up content.php and do the same thing. I am going to post this now and work on the next one and post that in a few minutes.

    Theme Author ThemeAWESOME

    (@tsquez)

    Ok now for the second part where you want to put this line not under the title but at the end of the post.

    Again easy enough. Let’s go ahead and open the file content.php again and look for lines 24 through 30. You should see something like this:

    <div class="entry-meta-header">
    				<?php wpforge_entry_meta_header(); ?>
    				<?php if ( comments_open() ) : ?>
    					<span class="genericon genericon-comment"></span> <?php comments_popup_link( '<span class="leave-reply">' . __( 'Comment', 'wp-forge' ) . '</span>', __( '1 Comment', 'wp-forge' ), __( '% Comments', 'wp-forge' ) ); ?>
    				<?php endif; // comments_open() ?>
    				<?php edit_post_link( __( 'Edit', 'wp-forge' ), '<span class="edit-link"><span class="genericon genericon-edit"></span> ', '</span>' ); ?>
    			</div><!-- end .entry-meta-header -->

    This portion of code is what is responsible for displaying the date, the author, comments and the edit link just under the title. Copy lines 24 through 30 and scroll down to line 43 (it should look like this: <?php wp_link_pages( array( 'before' => '<div class="page-links">' . __( 'Pages:', 'wp-forge' ), 'after' => '</div>' ) ); ?>, press enter (to create a new line) and paste what you copied here. Be sure to go back up and delete the duplicate lines 24 through 30 you just copied and save your work.

    Now this portion will appear at the end of the post. The styles for .entry-meta-header element are located on line 476 in style.css of WP-Forge. If you are using a child theme you can copy line 476 through 483 into your child theme css and modify to your liking.

    Hope this helps. Now to work on the third issue. We are almost there….yay!

    Theme Author ThemeAWESOME

    (@tsquez)

    Now for the last item: In the ligne date of the post/author/comments I want to remove author.. This one is going to be a little more involved but we can do it. Just make sure you follow along closly.

    For this I am going to first show you how to change it in WP-Forge directly, then I will show you how to do it for a child thme. Understand though, if you are not using a child theme and you update WP-Forge you will lose this change and then you will have to go back and do it again.

    Ok so locate the file functions.php in WP-Forge. Scroll down to line 656. This is the beginning of the actual function that controls the date and author. It startes on line 656 and ends on line 676. It looks like this:

    /**
     * Print HTML with meta information for the current post-date/time and author.
     *
     * @since WP-Forge 5.5.1.8
     */
    if ( ! function_exists( 'wpforge_entry_meta_header' ) ) :
    	function wpforge_entry_meta_header() {
    		if ( is_sticky() && is_home() && ! is_paged() ) {
    			echo '<span class="genericon genericon-pinned"></span> <span class="sticky-post">' . __( 'Sticky', 'wp-forge' ) . '</span>';
    		}
    
    		// Set up and print post meta information.
    		printf( '<span class="entry-date updated"><span class="genericon genericon-time"></span><a href="%1$s" rel="bookmark"><time class="entry-date" datetime="%2$s">%3$s</time></a></span> <span class="byline"><span class="genericon genericon-user"></span><span class="author vcard"><a class="url fn n" href="%4$s" rel="author">%5$s</a></span></span>',
    			esc_url( get_permalink() ),
    			esc_attr( get_the_date( 'c' ) ),
    			esc_html( get_the_date() ),
    			esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
    			get_the_author()
    		);
    	}
    endif;

    Now we are going to modify it a little bit. Search for the following:

    <span class="byline"><span class="genericon genericon-user"></span><span class="author vcard"><a class="url fn n" href="%4$s" rel="author">%5$s</a></span> and delete it.

    After that look for line 672 which looks like this:
    esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ), and delete it.

    Now look for get_the_author() and delete this as well.

    Also make sure that after you delete esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ), and get_the_author() you remove the comma at the end of esc_html( get_the_date() ),.

    So it should look like this esc_html( get_the_date() ). If you do not remove that comma you will get a php error.

    OK so now let’s do it the child theme way. If you do this then you wont lose this edit when you update WP-Forge.

    Open functions.php of WP-Forge and copy lines 656 through 676. Now open up functions.php of your child theme and paste what you copied.

    Now locate <span class="byline"><span class="genericon genericon-user"></span><span class="author vcard"><a class="url fn n" href="%4$s" rel="author">%5$s</a></span> and delete it.

    After that look for esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ), and delete it.

    Now look for get_the_author() and delete this as well.

    Same as above, make sure that after you delete esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ), and get_the_author() you remove the comma at the end of esc_html( get_the_date() ),. So it should look like this esc_html( get_the_date() ).

    Remember, if you do not remove that comma you will get a php error.

    Hope this helps. Enjoy!

    Theme Author ThemeAWESOME

    (@tsquez)

    Closing as resolved

    Thread Starter Alissa_WP

    (@alissa_wp)

    Thank you so much Tsquez ! It’s perfect !!!

    (and sorry for my late reply , I was whitout Internet for many days ! )

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘how change post/author/comment/categorie’ is closed to new replies.