Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #877178
    Cindy H
    Participant

    I want to remove the following from the blog – meta data.

    1) The word “IN”, and the commas between categories
    2) The word “BY”, and the username
    3) Remove the / and Date of post

    I want to MOVE the categories to below the “READ MORE”

    Can anybody advise me on how to accomplish this?

    Blog

    Here is the screenshot of how I would like to have the final product look like.

    #877185
    Cindy H
    Participant

    Here is the screen shot

    #877812
    Paul R
    Moderator

    Hi Cindy,

    Thanks for writing in!

    To achieve that, you can add this in your child theme’s functions.php file

    
    function x_integrity_entry_meta() {
    
        //
        // Author.
        //
    
        $author = sprintf( '<span><i class="x-icon-pencil" data-x-icon=""></i> %s</span>',
          get_the_author()
        );
    
        //
        // Date.
        //
    
        $date = sprintf( '<span><time class="entry-date" datetime="%1$s"><i class="x-icon-calendar" data-x-icon=""></i> %2$s</time></span>',
          esc_attr( get_the_date( 'c' ) ),
          esc_html( get_the_date() )
        );
    
        //
        // Categories.
        //
    
        if ( get_post_type() == 'x-portfolio' ) {
          if ( has_term( '', 'portfolio-category', NULL ) ) {
            $categories        = get_the_terms( get_the_ID(), 'portfolio-category' );
            $separator         = ', ';
            $categories_output = '';
            foreach ( $categories as $category ) {
              $categories_output .= '<a href="'
                                  . get_term_link( $category->slug, 'portfolio-category' )
                                  . '" title="'
                                  . esc_attr( sprintf( __( "View all posts in: &ldquo;%s&rdquo;", '__x__' ), $category->name ) )
                                  . '"><i class="x-icon-bookmark" data-x-icon=""></i> '
                                  . $category->name
                                  . '</a>'
                                  . $separator;
            }
    
            $categories_list = sprintf( '<span>%s</span>',
              trim( $categories_output, $separator )
            );
          } else {
            $categories_list = '';
          }
        } else {
          $categories        = get_the_category();
          $separator         = ', ';
          $categories_output = '';
          foreach ( $categories as $category ) {
            $categories_output .= '<a href="'
                                . get_category_link( $category->term_id )
                                . '" title="'
                                . esc_attr( sprintf( __( "View all posts in: &ldquo;%s&rdquo;", '__x__' ), $category->name ) )
                                . '"><i class="x-icon-bookmark" data-x-icon=""></i> '
                                . $category->name
                                . '</a>'
                                . $separator;
          }
    
          $categories_list = sprintf( '<span>%s</span>',
            trim( $categories_output, $separator )
          );
        }
    
        //
        // Comments link.
        //
    
        if ( comments_open() ) {
    
          $title  = apply_filters( 'x_entry_meta_comments_title', get_the_title() );
          $link   = apply_filters( 'x_entry_meta_comments_link', get_comments_link() );
          $number = apply_filters( 'x_entry_meta_comments_number', get_comments_number() );
    
          if ( $number == 0 ) {
            $text = __( 'Leave a Comment' , '__x__' );
          } else if ( $number == 1 ) {
            $text = $number . ' ' . __( 'Comment' , '__x__' );
          } else {
            $text = $number . ' ' . __( 'Comments' , '__x__' );
          }
    
          $comments = sprintf( '<span><a href="%1$s" title="%2$s" class="meta-comments"><i class="x-icon-comments" data-x-icon=""></i> %3$s</a></span>',
            esc_url( $link ),
            esc_attr( sprintf( __( 'Leave a comment on: &ldquo;%s&rdquo;', '__x__' ), $title ) ),
            $text
          );
    
        } else {
    
          $comments = '';
    
        }
    
        //
        // Output.
        //
    
        if ( x_does_not_need_entry_meta() ) {
          return;
        } else {
          printf( '<p class="p-meta">%s</p>',   
            $categories_list  
          );
        }
    
      }
    

    Then add this in custom > css in the customizer

    
    .p-meta>span:after {
        display:none;
    }
    
    .p-meta>span>a {
        border-radius:5px;
        border:1px solid #777;
        padding:3px 5px;
    }
    

    Hope that helps.

    #878057
    Cindy H
    Participant

    That’s perfect thanks! I can format the rest from here.

    Is there a way to remove the comma’s between each category?

    #878224
    John Ezra
    Member

    Hi there,

    Thanks for updating the thread! Yes it is, you can remove the comma separator from the code provided above on this line:

    $separator = ', ';

    Hope this helps – thanks!

    #878278
    Cindy H
    Participant

    FANTASTIC! Thanks so much for the stellar support.

    #878532
    Cindy H
    Participant

    I have another question. Can I add it to this post or should I start a new thread?

    I want to set a default max with of 688px to all items that are located in a single column
    .x-column.x-1-1

    Right now I am using the css code

    .x-column.x-1-1 {
    max-width: 668px;
    }

    However my text is completely justified to the left. I would like this 668px box to be centered in my page.

    Is that possible?

    I have used the following for my blog, but can’t seem to figure out how to accomplish that in regular content.

    .single-post .x-container.max.width.offset {
    max-width: 668px;
    }

    http://dialectic.solutions/about-us/

    #879028
    Friech
    Moderator

    Hi There,

    Your page is in coming soon mode, would you mind providing us login credentials in private reply so we can take a closer look.

    Thanks.

  • <script> jQuery(function($){ $("#no-reply-877178 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>