WordPress.org

Ready to get started?Download WordPress

Forums

Path
[resolved] Remove author, date and time of posts (19 posts)

  1. tuviaserber
    Member
    Posted 1 year ago #

    Hi, I'm usind this theme and find it great.
    I've modified it to suit my needs, however, I can't find a way to remove the author (since there's only one in my site), the date and time of certain posts.

    That is, only posts in a specific category should show the published dat.

    I've looked aroung in google but this theme doesn't seem to have the same file structure as others, I couldn't fine the_date(), the_time() in any file...

    Please help! My site is http://www.jabadlaplata.org.ar

    Thank you!

  2. noahjonah
    Member
    Posted 1 year ago #

  3. tuviaserber
    Member
    Posted 1 year ago #

    Thank you for the reply! I sa the page, but it seams that the Path theme has different files... there are a few of the files listed there, but I don't see where to delete or add the code to do what I want to: that only posts from one category show creation date.

  4. Sami Keijonen
    Member
    Theme Author

    Posted 1 year ago #

    There is no need to modify any of the template files. Basically you just filter byline in your child theme functions.php. I can give you code snippet if you still have this issue.

  5. tuviaserber
    Member
    Posted 1 year ago #

    Hi Sami! I'm very happy you answered. I love your theme!.

    I'm not a pro on php, and this is my first (and probably last, since I don't work on this, I'm just a rabbi with programming knowledge...) site with wordpress.

    One of my mistakes was not to make a child theme, I modified the parent theme...

    I ended up modifying content.php, after a lot of looking into the files and realizing the Hybrid framework and the shortcuts into the php code.

    Below you'll find my idea. Please, send me the code snippet as it shouñd be...

    Thank you!!!

    <?php /* echo apply_atomic_shortcode( 'byline', '<div class="byline">' . __( 'Published by [entry-author] on [entry-published] [entry-comments-link before=" | "] [entry-edit-link before=" | "]', 'path' ) . '</div>' ); */ ?>
    
    			<?php $post_id = get_the_ID(); ?>
    			<?php $cat = get_the_category($post_id); ?>
    			<?php if ( $cat[0]->cat_ID == 9 ) {  /* 9 es Editoriales */?>
    			<?php 	echo apply_atomic_shortcode( 'byline', '<div class="byline">' . __( 'Publicado en [entry-published] [entry-comments-link before=" | "] [entry-edit-link before=" | "]', 'path' ) . '</div>' ); ?>
    			<?php }	?>
  6. Sami Keijonen
    Member
    Theme Author

    Posted 1 year ago #

    You're right. You should never edit parent theme files. Install a fresh copy of Path and after that download and activate Path Child from here.

    http://themehybrid.com/themes/path-child

    You might need to set menus and widgets again.

    After that open up child theme functions.php and put this inside setup function.

    add_filter( "{$prefix}_byline", 'my_byline', 11 );

    And this after setup function.

    function my_byline( $byline ) {
    
    	if( in_category( 'aaaa' ) ) {
    		$byline = '<div class="byline">' . __( 'Published by [entry-author] on [entry-published] [entry-comments-link before=" | "] [entry-edit-link before=" | "]', 'path' ) . '</div>';
    	}
    	else {
    		$byline = '';
    	}
    
    	return $byline;
    }

    Change to category slug aaaa for what you need. This disables byline for every other but not aaaa category posts.

  7. tuviaserber
    Member
    Posted 1 year ago #

    I'll try but I have a few questions:

    1) Will this affect all the information I already wrote?, like the posts and the pages I made.

    2) I created a few Templates for the kind of pages I use, for example, I have simple pages (default template), pages that list the posts of a certain category and pages that list the posts of two categories. All of this I created by copying a fresh index.php and adding some code. Where do I put this templates in the child theme?

    Thank you so much for getting involved on this!!

  8. Sami Keijonen
    Member
    Theme Author

    Posted 1 year ago #

    Just copy all of your custom templates to child theme folder and you're good to go.

  9. tuviaserber
    Member
    Posted 1 year ago #

    Thank you very much Sami. I'll try this later. Should I mark the topic as solved?

  10. tuviaserber
    Member
    Posted 1 year ago #

    I also have this code in my sidebar-primary.php:

    <?php dynamic_sidebar( 'primary' ); ?>
    
    		<?php echo "<h3>Avisos</h3>"; ?>
    		<?php query_posts('category_name=avisos&showposts=10'); ?>
    		<?php while (have_posts()) : the_post(); ?>
    			<?php the_content(); ?>
    			<?php echo "<p>&nbsp;</p>"; ?>
    		<?php endwhile;?>

    Where should it be in the child theme?

    Also, what about theme translation to spanish, where should I put it?

    Thank you!

  11. Sami Keijonen
    Member
    Theme Author

    Posted 1 year ago #

    Remove that code and use plugin like Query Posts.

    http://wordpress.org/extend/plugins/query-posts/

    Translation files goes to child theme languages-folder.

  12. tuviaserber
    Member
    Posted 1 year ago #

    I see. I'll try to make all this changes. To be honest, it scares me a little since the site is working like I at it to right now... and the menu is quite big to re-do it...

    What do you think? Is it worth doing all the changes just for code's sake?

    Thank you!

  13. Sami Keijonen
    Member
    Theme Author

    Posted 1 year ago #

    I'm not sure what you're trying to do but here are basic steps you should know.

    1. Don't modify parent theme (or WP core files). You will loose all of those modifications when you update theme. And I know you will update.

    2. Therefore you should always make modifications to child theme.

    http://codex.wordpress.org/Child_Themes

    3. There is no reason to add code like that in sidebar-primary.php. There are plenty of widget plugins that do that.

    4. If you have make modifications to parent theme style.css, copy styles (not file) to child theme style.css.

    5. If you have any further questions, I encourage you to join themehybrid.com. Path is officially supported there.

  14. tuviaserber
    Member
    Posted 1 year ago #

    Ok. Thank you very much for your speedy answers. I think I'll try the child theme before my site grows too much...

    Thanks again!

  15. ZiZaK
    Member
    Posted 1 year ago #

    Hello, im interested in the same issue. And i dont know how he resolved it.

    I like theme Path, but i dont know how to do it.

    Also i want to change You are here: Home and translate it to spanish

    Thank u all

  16. Sami Keijonen
    Member
    Theme Author

    Posted 1 year ago #

    Please open new topic for new questions.

  17. ZiZaK
    Member
    Posted 1 year ago #

    Thanks for the answer

  18. tuviaserber
    Member
    Posted 1 year ago #

    Hi, check file content.php under themes/path, there you'll find the 'bylines' that define what comes before and after each post.

    I really recommend Sami's solution of a child theme. My site grew already too much to use it, so I ended up modifying (a lot!) Sami's theme to fit my needs.

    Be well,

  19. vijit.pareek@gmail.com
    Member
    Posted 10 months ago #

    Hi Buddies there is a very simple way to disable author,date time and all other unwanted stuff.

      Just see the page source by left clicking on the page
      search for the line u want to disable
      go to theme css
      look for the div id or the span id (the div or the span should apply on the item u want to remove
      in the theme css add {display: none } against the item u want to remove

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic