WordPress.org

Ready to get started?Download WordPress

Forums

Catch Box
[resolved] How to ged rid of the Author name in a Post (6 posts)

  1. finnn
    Member
    Posted 3 months ago #

    Hi,

    I am using a Child Theme of Catch Box. On my Site I can Hide the Auhtorname by: .entry-meta .by-author { display: none; }. But when I open a single Post the Authorname is Back. And it is not possible to Hide it by CSS(I could Hide the .entry-meta Box but I want to have my categories displayed).
    So I thought it would be a good way to ged rid of the Authorname by writing a own function of catchbox_posted_on() and replace it. I tried it but i stucked in that. The Authorname is still there...

    Can someone explain me how to 'unload?/remove the original function in my child theme functions.php and replace it with nearly the same function, just without authorname?

    The original function in catch box theme functions.php:

    function catchbox_posted_on() {
    	printf( __( '<span class="sep">Posted on </span><a href="%1$s" title="%2$s" rel="bookmark"><time class="entry-date updated" datetime="%3$s" pubdate>%4$s</time></a><span class="by-author"> <span class="sep"> by </span> <span class="author vcard"><a class="url fn n" href="%5$s" title="%6$s" rel="author">%7$s</a></span></span>', 'catchbox' ),
    		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', 'catchbox' ), get_the_author() ) ),
    		get_the_author()
    	);
    }
  2. salsaturation
    Member
    Posted 3 months ago #

    The code definitely works

    .by-author {
    display: none;
    }

    Maybe there is some caching on your site or server?

    I don't think just adding the code to the function php will work as you have to tel it to remove the other code first and then load your version

  3. finnn
    Member
    Posted 3 months ago #

    On my Start Page it is working. But not if I open a Post. And I don't think that there is a way to hide just the author by CSS.

    Demo Site of Catchbox, just to show which type of Site I mean:
    http://catchthemes.com/demo/catchbox-pro/2012/12/23/layout-test/

    Around the Box starting with: #This entry was posted in' is only a .entry-meta und the Author is only a link. So I just could hide the hole Box to hide the Author.

    Yes, sure - that is exactly my problem. I know that I have to to tell my functions.php to unload/remove the old function and to load the new code instead but I don't know how :)

  4. salsaturation
    Member
    Posted 3 months ago #

    This is a caching / versioning issue. The same code will affect both the index and the single page... I went to your site and I can still see the author on the homepage as well and your style css has a version so it is not loading the most current one. Sometime a caching plugin can help. Install it activate it then navigate through a few pages on the front end then clear the cache using the plugin.

  5. Catch Themes
    Member
    Theme Author

    Posted 3 months ago #

    @finnn: For the code below the post. Just copy content-single.php file in your child theme and edit it. Change the following code in content-single.php

    if ( '' != $tag_list ) {
        $utility_text = __( 'This entry was posted in %1$s and tagged %2$s by <a href="%6$s">%5$s</a>. Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', 'catchbox' );
    } elseif ( '' != $categories_list ) {
        $utility_text = __( 'This entry was posted in %1$s by <a href="%6$s">%5$s</a>. Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', 'catchbox' );
    } else {
        $utility_text = __( 'This entry was posted by <a href="%6$s">%5$s</a>. Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', 'catchbox' );
    }

    with the following

    if ( '' != $tag_list ) {
        $utility_text = __( 'This entry was posted in %1$s and tagged %2$s. Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', 'catchbox' );
    } elseif ( '' != $categories_list ) {
        $utility_text = __( 'This entry was posted in %1$s. Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', 'catchbox' );
    } else {
        $utility_text = __( 'Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', 'catchbox' );
    }
  6. finnn
    Member
    Posted 3 months ago #

    Great!!! Thanks a lot, it works. I was so sticked to that functions.php that I didn't thought about another way to solve this :-D

Reply

You must log in to post.

About this Theme

About this Topic