WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] [closed] getting rid of posted on ... by" (28 posts)

  1. qim
    Member
    Posted 1 year ago #

    I lost track of an earlier post from yesterday. meanwhile i have found that the information seems to come from Adventure Journal style.css and loop.php where I found entry-date; meta-prep; meta-sp, author-vcard.

    Could somebody help me amend the PHP script text, as I have never done it before and am afraid of doing something wrong?

    Thank you

  2. qim
    Member
    Posted 1 year ago #

    I found the other post, which said:

    I managed something rather unprofessional, mostly because what I write in the post does not reflect what comes out on the web...

    What I would like to do now 8and it will be all for today...) is to get rid of the

    ""Edit
    Posted on 08/03/2013 by admin ""

    which was ledt behind and is now between the top picture and what I added now.

    How can I get rid of this, please?

    Thanks

    qim

    qim
    Member
    Posted 14 hours ago #

    Hi

    I think I found where I can delete it but do not dare touch the edit without some help.

    Adventure Journal has a single.php with a line

    <div class="meta">Posted by <?php the_author_posts_link(); ?> on <?php the_date();?></div>

    what could I do to this line to get rid of the "posted on " "date"?

    Thank you

    qim

  3. Andrei Olsen
    Member
    Posted 1 year ago #

    Just delete the div-line you posted above.

  4. qim
    Member
    Posted 1 year ago #

    Thanks

    Should I not back-up the script? I read somwhere about doing a new one in case the software gets updated. can you comment/help?

  5. Andrei Olsen
    Member
    Posted 1 year ago #

    You can create a child theme:
    http://codex.wordpress.org/Child_Themes

    and then add you modified single.php there.

  6. qim
    Member
    Posted 1 year ago #

    Thanks, I'm going to do that. before I lose you...

    What about style.css and loop.php (see first post above) Should I do something there too?

    Thank you very much

  7. Andrei Olsen
    Member
    Posted 1 year ago #

    As far as I can see loop.php doesn't have "Posted by...", at least v1.7.2 doesn't. It uses a custom function ctx_aj_posted_on which you can find in functions.php (line 585).

    Replace the function with for example

    function ctx_aj_posted_on() {
        // add the markup to display the author and the date
    }

    and add modified functions.php to your child theme.

  8. qim
    Member
    Posted 1 year ago #

    Ok I've done the child theme, but all I get in the folder is style.css.

    How do I delete the div-line in single.php (and maybe in lopp.php)?

    Do I leave style.css alone now?

  9. Andrew
    Forum Moderator
    Posted 1 year ago #

    Copy any file you want to edit into your Child Theme directory. You can then edit it there.

  10. qim
    Member
    Posted 1 year ago #

    Sorry, our last messages crossed. Meanwhile this is part of what i find in Adventure Journey loop.php:

    [ Moderator Note: Please post code or markup snippets between backticks or use the code button. ]

    <?php if ( in_category( _x('gallery', 'gallery category slug', 'adventurejournal') ) ) : ?>
    		<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
                        <?php edit_post_link( __( 'Edit', 'adventurejournal' ), '<span class="edit-link">', '</span>' ); ?>
    			<h2 class="entry-title"><a>" title="<?php printf( esc_attr__( 'Permalink to %s', 'adventurejournal' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
    
    			<strong><div class="entry-meta">
    				<?php ctx_aj_posted_on(); ?></strong>
    			</div><!-- .entry-meta -->
    
    			<div class="entry-content">
  11. Andrew
    Forum Moderator
    Posted 1 year ago #

    BTW you can visit your profile link to see your previous posts.

  12. qim
    Member
    Posted 1 year ago #

    Hi
    I tried twice to delete the line but instead is the line below that disappears... Fortunately it is empty anyway.

    I am using the Code Editor. It has a button for "Use Text editor"

    Which should I use, please?

    qim

  13. Andrew
    Forum Moderator
    Posted 1 year ago #

    As there are two versions of Adventure theme, may I ask where you got your theme from?

  14. qim
    Member
    Posted 1 year ago #

    I downloaded it from within WP. Version 1.7.2

    But now I have another doubt: the line I am trying to delete which is above reads:
    <div class="meta">Posted by <?php the_author_posts_link(); ?> on <?php the_date();?></div>

    But what I see on screen and am trying to get rid of, reads:

    posted on (date) by (admin)

    help...

  15. Andrew
    Forum Moderator
    Posted 1 year ago #

    Perhaps you're in the wrong template. In your Child Theme, select all the lines of that file you're trying to modify and delete them. Delete all contents in the file. Refresh the page and see if it affects your webpage.

  16. qim
    Member
    Posted 1 year ago #

    Ohhh, drastic!!!

    Well, I did like you proposed and, yes, the stuff is still there. So, now I guess I should delete the file single.php frpm my child theme, and then what?

  17. Andrew
    Forum Moderator
    Posted 1 year ago #

    Then see if that posted on line disappears from your webpage.
    You may have to clear your browser's cache or deactivate any caching plugins.

    If it doesn't delete the line you want, try deleting this bit of the code (assuming it's in the same file);

    <?php ctx_aj_posted_on(); ?>
  18. qim
    Member
    Posted 1 year ago #

    Well, yes that code is in loop.php, but I could not find references to the date (entry-date?) or to "by" (meta-sep?)

    <div class="entry-meta">
    <?php ctx_aj_posted_on(); ?>
    </div><!-- .entry-meta -->

    <div class="entry-content">
    <?php if ( post_password_required() ) : ?>
    <?php the_content(); ?>
    <?php else : ?>

  19. qim
    Member
    Posted 1 year ago #

    In fact, there are two entries:

    [ Moderator Note: Please post code or markup snippets between backticks or use the code button. ]

    <div class="entry-utility">
    				<?php ctx_aj_posted_on(); ?>
    				<span class="meta-sep">|</span>
    				<span class="comments-link"><?php comments_popup_link( __( 'Leave a comment', 'adventurejournal' ), __( '1 Comment', 'adventurejournal' ), __( '% Comments', 'adventurejournal' ) ); ?></span>
    
    			</div><!-- .entry-utility -->
    		</div><!-- #post-## -->
    
    <?php /* How to display all other posts. */ ?>
    
    	<?php else : ?>
    		<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
                        <?php
                            $myclasses=join(' ',get_post_class('',$id));
                            if( preg_match('/sticky/',$myclasses) > 0 ){
                                echo '<div class="tape tr"> </div><div class="tape bl"> </div>';
                            }
                        ?>
                        <?php edit_post_link( __( 'Edit', 'adventurejournal' ), '<span class="edit-link">', '</span>' ); ?>
    			<h2 class="entry-title"><a>" title="<?php printf( esc_attr__( 'Permalink to %s', 'adventurejournal' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
                            <?php if(is_home() && has_post_thumbnail() && $themeOpts['featured-header']!='true' ) the_post_thumbnail(); ?>
    			<div class="entry-meta">
    				<?php ctx_aj_posted_on(); ?>
    			</div><!-- .entry-meta -->
    
    	<?php if ( is_archive() || is_search() ) : // Only display excerpts for archives and search. ?>
    			<div class="entry-summary">
    				<?php the_excerpt(); ?>
    			</div><!-- .entry-summary -->
    	<?php else : ?>
    			<div class="entry-content">
    				<?php the_content( __( 'Read more <span class="meta-nav">»</span>', 'adventurejournal' ) ); ?>
    				<?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Post pages:', 'adventurejournal' ), 'after' => '</div>' ) ); ?>
                                <div class="clear"></div>
  20. qim
    Member
    Posted 1 year ago #

    I don't know if this helps. It is the Original Source which you can see from the actual webpage:

    [ Moderator Note: Please post code or markup snippets between backticks or use the code button. ]

    <div class="entry-meta">
    				<span class="meta-prep meta-prep-author">Posted on</span> <a href="http://pintotours.net/2013/03/08/40/" title="16:01" rel="bookmark"><span class="entry-date">08/03/2013</span></a> <span class="meta-sep">by</span> <span class="author vcard"><a href="http://pintotours.net/author/admin/" title="View all posts by admin">admin</a></span>			</div><!-- .entry-meta -->
  21. qim
    Member
    Posted 1 year ago #

    I'm very sorry but every time I look at loop.php I find new entries of the code that you gave me. if you have time please look at the whole loop.php:

    http://pastebin.com/Fn2nCRr7

    Thank you

  22. qim
    Member
    Posted 1 year ago #

    In the code that I sent you there were eventually theree occasions of <?php ctx_aj_posted_on(); ?>

    I deleted all three and hey presto Total Success.

    Now I need to remove or use as future links the line at the bottom that has Categories: Uncategorized|Leave a comment

    Can you advise please?

    thank you

  23. qim
    Member
    Posted 1 year ago #

    There are 3 mentions of Leave a comment in the loop.php which I sent in the pastebin above. But no references to the other two: categories and Uncategorized.

    thank you

  24. Andrew
    Forum Moderator
    Posted 1 year ago #

    What does line 158 do?

  25. qim
    Member
    Posted 1 year ago #

    Hi Andrew
    158:
    <?php printf( __( '<span class="%1$s">Categories: </span> %2$s', 'adventurejournal' ), 'entry-utility-prep entry-utility-prep-cat-links', get_the_category_list( ', ' ) ); ?>

    Now I would like to get rid of the rubbish at the bottom but I'm afraid to touch it without help.

  26. qim
    Member
    Posted 1 year ago #

    Well, I've found and apparently solved part of it:

    a) I found 3 entries for "Leave a Comment" and just to see if that was what I was lookinbg for renamed it. It worked. maybe I can use that as a button for something else.
    b) the first word which was categories, I found print command which I deleted and the word disappeared.

    c) I am still stuck with "Uncategorized". I have gone through half the files and so far found an entry in wp-admin/includes/upgrade.php

    Could that be it?

    Here is part of the code:

    if ( !function_exists('wp_install_defaults') ) :
    /**
     * {@internal Missing Short Description}}
     *
     * {@internal Missing Long Description}}
     *
     * @since 2.1.0
     *
     * @param int $user_id User ID.
     */
    function wp_install_defaults($user_id) {
    	global $wpdb, $wp_rewrite, $current_site, $table_prefix;
    
    	// Default category
    	$cat_name = __('Uncategorized');
    	/* translators: Default category slug */
    	$cat_slug = sanitize_title(_x('Uncategorized', 'Default category slug'));
    
    	if ( global_terms_enabled() ) {
    		$cat_id = $wpdb->get_var( $wpdb->prepare( "SELECT cat_ID FROM {$wpdb->sitecategories} WHERE category_nicename = %s", $cat_slug ) );
    		if ( $cat_id == null ) {
    			$wpdb->insert( $wpdb->sitecategories, array('cat_ID' => 0, 'cat_name' => $cat_name, 'category_nicename' => $cat_slug, 'last_updated' => current_time('mysql', true)) );
    			$cat_id = $wpdb->insert_id;
    		}
    		update_option('default_category', $cat_id);
    	} else {
    		$cat_id = 1;
  27. qim
    Member
    Posted 1 year ago #

    I found another entry that looks more promising in wp-includes/template.php

    I would be grateful if you could see if I can get rid of this "Uncategorized" at the bottom of the page.

    Thank you

    /**
     * Retrieve category list in either HTML list or custom format.
     *
     * @since 1.5.1
     *
     * @param string $separator Optional, default is empty string. Separator for between the categories.
     * @param string $parents Optional. How to display the parents.
     * @param int $post_id Optional. Post ID to retrieve categories.
     * @return string
     */
    function get_the_category_list( $separator = '', $parents='', $post_id = false ) {
    	global $wp_rewrite;
    	if ( ! is_object_in_taxonomy( get_post_type( $post_id ), 'category' ) )
    		return apply_filters( 'the_category', '', $separator, $parents );
    
    	$categories = get_the_category( $post_id );
    	if ( empty( $categories ) )
    		return apply_filters( 'the_category', __( 'Uncategorized' ), $separator, $parents );
    
    	$rel = ( is_object( $wp_rewrite ) && $wp_rewrite->using_permalinks() ) ? 'rel="category tag"' : 'rel="category"';
    
    	$thelist = '';
    	if ( '' == $separator ) {
    		$thelist .= '<ul class="post-categories">';
    		foreach ( $categories as $category ) {
    			$thelist .= "\n\t<li>";
    			switch ( strtolower( $parents ) ) {
    				case 'multiple':
    					if ( $category->parent )
    						$thelist .= get_category_parents( $category->parent, true, $separator );
    					$thelist .= '<a href="' . esc_url( get_category_link( $category->term_id ) ) . '" title="' . esc_attr( sprintf( __( "View all posts in %s" ), $category->name ) ) . '" ' . $rel . '>' . $category->name.'</a></li>';
    					break;
    				case 'single':
    					$thelist .= '<a href="' . esc_url( get_category_link( $category->term_id ) ) . '" title="' . esc_attr( sprintf( __( "View all posts in %s" ), $category->name ) ) . '" ' . $rel . '>';
    					if ( $category->parent )
    						$thelist .= get_category_parents( $category->parent, false, $separator );
    					$thelist .= $category->name.'</a></li>';
    					break;
    				case '':
    				default:
    					$thelist .= '<a href="' . esc_url( get_category_link( $category->term_id ) ) . '" title="' . esc_attr( sprintf( __( "View all posts in %s" ), $category->name ) ) . '" ' . $rel . '>' . $category->name.'</a></li>';
    			}
    		}
    		$thelist .= '</ul>';
    	} else {
    		$i = 0;
    		foreach ( $categories as $category ) {
    			if ( 0 < $i )
    				$thelist .= $separator;
    			switch ( strtolower( $parents ) ) {
    				case 'multiple':
    					if ( $category->parent )
    						$thelist .= get_category_parents( $category->parent, true, $separator );
    					$thelist .= '<a href="' . esc_url( get_category_link( $category->term_id ) ) . '" title="' . esc_attr( sprintf( __( "View all posts in %s" ), $category->name ) ) . '" ' . $rel . '>' . $category->name.'</a>';
    					break;
    				case 'single':
    					$thelist .= '<a href="' . esc_url( get_category_link( $category->term_id ) ) . '" title="' . esc_attr( sprintf( __( "View all posts in %s" ), $category->name ) ) . '" ' . $rel . '>';
    					if ( $category->parent )
    						$thelist .= get_category_parents( $category->parent, false, $separator );
    					$thelist .= "$category->name</a>";
    					break;
    				case '':
    				default:
    					$thelist .= '<a href="' . esc_url( get_category_link( $category->term_id ) ) . '" title="' . esc_attr( sprintf( __( "View all posts in %s" ), $category->name ) ) . '" ' . $rel . '>' . $category->name.'</a>';
    			}
    			++$i;
    		}
    	}
    	return apply_filters( 'the_category', $thelist, $separator, $parents );
    }
  28. qim
    Member
    Posted 1 year ago #

    I got some more information:

    reference to "Uncategorized" is in 4 files:

    wp-admin\edit-tags.php (line 191)
    wp-admin\optoons-permalink.php (lines 38, 124)
    wp-includes\category-template.php (line 161)
    wp-includes\upgrade.php (lines 107, 109)

    Could you help meremove the display of "Uncategorized" from the bottom of the blog, please?

    Thank you

    qim

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.