• Resolved jacek_sliwek

    (@jacek_sliwek)


    Hey,
    After each post I have something like this: “This entry was posted in…”
    i found post in forum how remove it but i have different code and i don’t know how i can remove it.
    In functions.php i found function and I have:

    Template function posted in
     *
     *
     *
     * loop.php
     *
     */
        if ( ! function_exists( 'raindrops_posted_in' ) ) {
    
            function raindrops_posted_in( ) {
    
                global $post;
    
                if( is_sticky() ){
                    return;
                }
    
                $format     = get_post_format( $post->ID );
                $tag_list   = get_the_tag_list( '', ' ' );
    
                if ( $format === false ) {
    
                    if ( $tag_list ) {
                        $posted_in = '<span class="this-posted-in">'.
                                        esc_html__( 'This entry was posted in','Raindrops' ).
                                        '</span> %1$s <span class="tagged">'.
                                        esc_html__( 'and tagged', 'Raindrops' ).
                                        '</span> %2$s <span class="bookmark-the">'.
                                        esc_html__( 'Bookmark the', 'Raindrops' ).
                                        '</span>';
    
                    } elseif ( is_object_in_taxonomy( get_post_type( ), 'category' ) ) {
                        $posted_in = '<span class="this-posted-in">'.
                                        esc_html__( 'This entry was posted in', 'Raindrops' ).
                                        '</span> %1$s ';
                    } else {
                        $posted_in = '';
                    }
    
                    $result = $format.sprintf(  $posted_in,
                                                get_the_category_list( ' ' ),
                                                $tag_list
                                            );
    
                    echo apply_filters( "raindrops_posted_in", $result );
    
                }
    												else{
    
                    if ( $tag_list ) {
    
                        $posted_in = '<span class="this-posted-in">'.
                                        esc_html__( 'This entry was posted in','Raindrops' ).
                                        '</span> %1$s <span class="tagged">'.
                                        esc_html__( 'and tagged', 'Raindrops' ).
                                        '</span> %2$s '.
                                        '  <span class="post-format-text">%4$s</span> <a href="%3$s"> <span class="post-format">%5$s</span></a>';
    
                    } elseif ( is_object_in_taxonomy( get_post_type( ), 'category' ) ) {
    
                        $posted_in = '<span class="this-posted-in">'.
                                        esc_html__( 'This entry was posted in', 'Raindrops' ).
                                        '</span> %1$s %2$s'.
                                        '  <span class="post-format-text">%4$s</span><a href="%3$s"> <span class="post-format">%5$s</span></a>';
    
                    } else {
    
                        $posted_in = '<a href="%3$s">   <span class="post-format-text">%4$s</span> <span class="post-format">%5$s</span></a>';
                    }
    
                     $result = printf(  $posted_in,
                                        get_the_category_list( ' ' ),
                                        $tag_list,
                                        esc_url( get_post_format_link( $format ) ),
                                        esc_html( 'Format', 'Raindrops' ),
                                        get_post_format_string( $format )
                                    );
    
                    echo apply_filters( "raindrops_posted_in", $result );
    
                }
            }
        }
    /**

    what should I do to remove “This entry was posted in…”
    please help me

Viewing 9 replies - 1 through 9 (of 9 total)
  • Are you using a child theme?

    Thread Starter jacek_sliwek

    (@jacek_sliwek)

    no I’m not, but thanks for this link, I will read it. Meybey it helps me.

    thanks esmi

    Do not edit the theme itself. First create a child theme for your changes.

    Thread Starter jacek_sliwek

    (@jacek_sliwek)

    ok, I do it later in the evening.
    thans

    Theme Author nobita

    (@nobita)

    Hi jacek_sliwek

    I recommend the use of child themes

    3way of delete ‘This entry was posted in’

    1. using CSS
    Add style.css

    .this-posted-in{
    	display:none;
    }

    2. using gettext filter
    Add functions.php

    <?php
    add_filter('gettext', 'raindrops_change_translate',10,3);
    
    function raindrops_change_translate($translation, $text, $domain) {
    
    	$names= array(
    		'This entry was posted in' => '',
    		);
    
     if ($domain == 'Raindrops') {
     	$translation= str_replace(array_keys($names), array_values($names), $translation);
     }
     return $translation;
    }
    ?>

    3.using raindrops_posted_in filter
    Add functions.php

    <?php
    add_filter( 'raindrops_posted_in','my_remove_string_this_entry_was_posted_in' );
    
    function my_remove_string_this_entry_was_posted_in( $posted_in ) {
    
    	return str_replace( '<span class="this-posted-in">This entry was posted in</span>', '', $posted_in );
    }
    ?>

    note: child theme style.css

    @import url("../twentyfourteen/style.css");

    Raindrops theme no need @import rule like above.

    Thank you.

    Thread Starter jacek_sliwek

    (@jacek_sliwek)

    hi everyone, pleas don’t resolve this post, w don’t have a time to check what you wrote, because I have a lot of work in this week, if i have any time i will check this, ok.

    thanks for understanding

    Thread Starter jacek_sliwek

    (@jacek_sliwek)

    ok, thanks to help me remove this problem, I have next one, I also want to remove category, and “Posted on ‘date’ by ‘author’.
    I’ve included a link to the photo, there is a marked what I want to remove
    http://trebor-tim.com.pl/post.jpg

    Theme Author nobita

    (@nobita)

    I have next one,

    Sorry, Please create a new post.

    Thread Starter jacek_sliwek

    (@jacek_sliwek)

    ok, thanks

    resolved

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘delete "This entry was posted in"’ is closed to new replies.