Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1353641
    oga23
    Participant

    Hi,
    i found this code in some of your replies.

    function x_renew_entry_meta() {
    
        //
        // Author.
        //
    
        $author = sprintf( '<span>%s</span>',
          get_the_author()
        );
    
        //
        // Date.
        //
    
        $date = sprintf( '<span><time class="entry-date" datetime="%1$s">%2$s</time></span>',
          esc_attr( get_the_date( 'c' ) ),
          esc_html( get_the_date( 'm.Y' ) )
        );
    
        //
        // 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 ) )
                                  . '"> '
                                  . $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 ) )
                                . '">'
                                . $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">%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 {
           if(x_is_portfolio_item()):
          printf( '<p class="p-meta">%1$s%2$s</p>',
            $categories_list,
            $comments
          );
          else:
           printf( '<p class="p-meta">%1$s%2$s%3$s%4$s</p>',
            $author,
            $date,
            $categories_list,
            $comments
          );
          endif;
        }
    
      }

    But it is for the renew theme and when i change first line from renew to integrity, the icons for category and come are gone.
    Can you please provide me with a code like this for the integrity stack?

    Much appriciated. Thanks.

    #1353654
    Thai
    Moderator

    Hi There,

    You don’t have to change the template file.

    Please add the following CSS under Customizer > Custom > Global CSS:

    .single-x-portfolio .p-meta span:nth-child(1),
    .single-x-portfolio .p-meta span:nth-child(2) {
        display: none;
    }

    Hope it helps 🙂

    #1353848
    oga23
    Participant

    isn’t it beter(seo wise) to add some code to child theme? so something doesn’t have to be loaded in the first place and then being prevented from displaying via css afterwards?
    css is pileing up on my site 😉

    thanks for your answer👍

    #1353849
    oga23
    Participant

    isn’t it beter(seo wise) to add some code to child theme? so something doesn’t have to be loaded in the first place and then being prevented from displaying via css afterwards?
    css is pileing up on my site 😉

    thanks for your answer👍

    #1353850
    oga23
    Participant

    isn’t it beter(seo wise) to add some code to child theme? so something doesn’t have to be loaded in the first place and then being prevented from displaying via css afterwards?
    css is pileing up on my site 😉

    thanks for your answer👍

    #1353853
    oga23
    Participant

    isn’t it beter(seo wise) to add some code to child theme? so something doesn’t have to be loaded in the first place and then being prevented from displaying via css afterwards?
    css is pileing up on my site 😉

    thanks for your answer👍

    #1353929
    Thai
    Moderator

    Hi There,

    In that case, please add the following code under functions.php file locates in your child theme:

    function x_integrity_entry_meta() {
    
    	//
    	// Author.
    	//
    	global $post;
    	$author = sprintf( '<span><a href="%s"><i class="x-icon-pencil" data-x-icon=""></i> %s</a></span>',
          get_author_posts_url($post->post_author),
          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() );
    
    	  $text = ( 0 === $number ) ? 'Leave a Comment' : sprintf( _n( '%s Comment', '%s Comments', $number, '__x__' ), $number );
    
    	$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">%1$s%2$s</p>',
    	    $categories_list,
    	    $comments
    	  );
    	}
    
    }

    Hope it helps 🙂

    #1353989
    oga23
    Participant

    YEs! it works like a charm! thank you soo much!

    can you please advise how to close the gap on my homepage between h1 and h3? it is quite big so i can’t put averything in the screen on the bacground picture….
    beta.mojzastopnik.si

    thank you.

    #1354219
    Jade
    Moderator

    Hi there,

    Please add the class mtn to the h3 element to close the gap.

    Hope this helps.

    #1354734
    oga23
    Participant

    that is amazing! thank you so much.

    may i ask hpw did you make the title font thinner in the integrity demo 1? in the section below the revolution slider with the circle images? everything i try it does not work.

    regards.

    #1354837
    Friech
    Moderator

    Hi There,

    You mean the STACKS, EXPERTS, and CUSTOMIZER? You can add font-weight: 400; on the STYLE field of your headline or text element.

    What font-family you’re using? Sometimes it depends on the font-family if it does have support for font-weight thin.

    font-weight value is from 100 (thin) to 900 (bold)

    Hope it helps, Cheers!

    #1354946
    oga23
    Participant

    i am using raleway for titles, it has different weight values, but the code doesn’t help. i tried that. maybe the reponse-h man class is preventing it to change?

    #1354997
    Paul R
    Moderator

    Hi,

    Please navigate to Appearance > Customize > Typography > Body and Content and set font weight to 300.

    https://www.screencast.com/t/61h1yVG7

    Thanks

    #1355010
    oga23
    Participant

    yes,i can do that, but how can i make other titles bold? for example shop, portfolio, blog, etc…?

    #1355047
    oga23
    Participant

    what is function of resp-h-timeline/man class? maybe is it causing the font wieght to be fixed?

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