Navigation
This is archived content. Visit our new forum.
  • Author
    Posts
  • #112646
    Tim
    Participant

    Hi i would like to change my p-meta. but due to poor php knowledge i cant get it working.

    Rigth now my p-meta looks like this:

    admin/ 09.2014/ Allgemein/ Leave a Comment

    and i would rather like it to be like this:

    SEPTEMBER 14. 2014/ categorie

    Is that posible?

    #112676
    Nabeel A
    Moderator

    Hi Till,

    Please provide us the URL of your website so we can take a look into your issue.

    #114089
    Tim
    Participant
    #114154
    Christopher
    Moderator

    Hi there,

    Please create a Child theme:

    http://theme.co/x/member/kb/how-to-setup-child-themes/

    Then using this guide:

    http://theme.co/x/member/kb/customization-best-practices/

    Please copy the file below:

    wp-content/themes/x/framework/functions/renew.php

    to:

    wp-content/themes/x-child-renew/framework/functions/renew.php

    and change the code from line 20-113 into:

    if ( ! function_exists( 'x_renew_entry_meta' ) ) :
      function x_renew_entry_meta() {
    
        $author = sprintf( '<span>%s</span>',
          get_the_author()
        );
    
        $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( 'F d.Y' ) )
        );
    
        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 )
          );
        }
    
        if ( comments_open() ) {
          $title  = get_the_title();
          $link   = get_comments_link();
          $number = get_comments_number();
          if ( $number == 0 ) {
            $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 ) ),
              __( 'Leave a Comment' , '__x__' )
            );
          } else if ( $number == 1 ) {
            $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 ) ),
              $number . ' ' . __( 'Comment' , '__x__' )
            );
          } else {
            $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 ) ),
              $number . ' ' . __( 'Comments' , '__x__' )
            );
          }
        } else {
          $comments = '';
        }
    
        if ( x_does_not_need_entry_meta() ) {
          return;
        } else {
          printf( '<p class="p-meta">%1$s%2$s%3$s%4$s</p>',
            $author,
            $date,
            $categories_list,
            $comments
          );
        }
    
      }
    endif; 
    

    That will do the trick 🙂

    #115899
    Tim
    Participant

    Sorry nothing happend…. i made a functions direktory in my child theme because there was none. may that be the problem?

    #115932
    Darshana
    Moderator

    Hi there,

    Would you mind providing us with login credentials so we can take a closer look? To do this, you can make a post with the following info:

    – Link to your site
    – WordPress Admin username / password
    – FTP credentials

    Don’t forget to select Set as private reply. This ensures your information is only visible to our staff.

    #120368
    Tim
    Participant
    This reply has been marked as private.
    #120528
    Paul R
    Moderator

    Hi Till,

    Sorry for the confusion there.

    Please transfer the code into wp-content/themes/x-child-renew/functions.php
    You may remove the functions directory you created

    Thanks

    #121146
    Tim
    Participant
    This reply has been marked as private.
    #121412
    Zeshan
    Member

    Hi Till,

    Thank you for writing in!

    The above code provided contains functions which aren’t specified in your version of X theme (2.2.0). Please update your theme and bundled plugins to the latest versions (2.6.0) and the issue should be resolved.

    Please review our update guide.

    Hope this helps. 🙂

    Thank you.

    #121957
    Tim
    Participant

    Hi. Completed the update but still, the blog page wont load since adding code to functions.php.

    Thru a link on my home page i can go to one of the posts. the bottom of the page gives me the folowing message:

    Fatal error: Call to undefined function x_google_authorship_meta() in /homepages/44/d28670702/htdocs/sandbanksylt/test/wp-content/themes/x-child-renew/framework/views/renew/content.php on line 21

    #122283
    Paul R
    Moderator

    Hi Till,

    Can you try it again.

    I deleted <?php x_google_authorship_meta(); ?> in wp-content/themes/x-child-renew/framework/views/renew/content.php

    It is no longer needed in the latest version of xtheme

    Thanks

    #122380
    Tim
    Participant

    Now it us working thank you!

    I still ned to remove the “Admin” and “leave a coment” part

    where can i do so?

    #122381
    Tim
    Participant

    Also i would like to move that line above the tittle of the block. Can you tell me how to do that?

    #122638
    Rad
    Moderator

    Hi there,

    From the code you just added at functions.php,

    1. Find this :

    $author = sprintf( '<span>%s</span>',
          get_the_author()
        );

    And change it into this

    $author = '';

    2. Then add this :

    $comments = '';

    Directly on top of this if ( x_does_not_need_entry_meta() ) { which should be under `else {
    $comments = ”;
    }`

    Or, just turn off comments.

    3. Copy this template /wp-content/themes/x/framework/views/renew/_content-post-header.php to your child theme ( /wp-content/themes/x-child-renew/framework/views/renew/_content-post-header.php )

    Then replace its code by this :

    <?php
    
    // =============================================================================
    // VIEWS/RENEW/_CONTENT-POST-HEADER.PHP
    // -----------------------------------------------------------------------------
    // Standard <header> output for various posts.
    // =============================================================================
    
    ?>
    
    <header class="entry-header">
      <?php x_renew_entry_meta(); ?>
      <?php if ( is_single() ) : ?>
      <h1 class="entry-title"><?php the_title(); ?></h1>
      <?php else : ?>
      <h2 class="entry-title">
        <a href="<?php the_permalink(); ?>" title="<?php echo esc_attr( sprintf( __( 'Permalink to: "%s"', '__x__' ), the_title_attribute( 'echo=0' ) ) ); ?>"><?php the_title(); ?></a>
      </h2>
      <?php endif; ?>
    </header>

    Hope this helps.

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