Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1288575
    outer_net
    Participant

    Hey guys,

    I don’t know how it has happened but my posts (News) Page is in a real mess!

    http://www.waterstreetgallery.co.uk/news/

    This is the culprit:

    // Get Featured Image URL // ============================================================================= if ( ! function_exists( ‘x_get_featured_image_url’ ) ) : function x_get_featured_image_url( $size = ‘full’ ) { $featured_image = wp_get_attachment_image_src( get_post_thumbnail_id(), array( 300, 212 ) ); $featured_image_url = $featured_image[0]; return $featured_image_url; } endif;

    I can’t seem to find how or why it appearing in the posts.

    It has been a while since we have needed to use a post but now I don’t know where to start.

    Any help would be great,

    Thanks
    Abs

    #1288576
    outer_net
    Participant
    This reply has been marked as private.
    #1288778
    Christopher
    Moderator

    Hi there,

    Please update your code to :

    // Get Featured Image URL // =============================================================================
     if ( ! function_exists( 'x_get_featured_image_url' ) ) :
      function x_get_featured_image_url( $size = 'full' ) {
      $featured_image = wp_get_attachment_image_src( get_post_thumbnail_id(), array( 300, 212 ) ); 
      $featured_image_url = $featured_image[0]; return $featured_image_url; 
    } 
    endif;

    Hope it helps.

    #1288839
    outer_net
    Participant

    Great, thanks

    Where is this code located ? CSS

    #1288868
    Christopher
    Moderator

    Hi there,

    It’s located under child theme’s functions.php file.
    You can access it via FTP account.

    Thanks.

    #1288879
    outer_net
    Participant

    Ahhh,

    I don’t know what I have done -things have gone a bit pete tong!

    The code was not in the Functions PHP file to start with.

    Please help ASAP

    Thanks

    #1288883
    outer_net
    Participant

    Every page seems messed up!!!!

    #1288892
    Christopher
    Moderator

    Hi there,

    I fixed two files:

    #1 I added following code to functions.php file and remove the other code :

    add_filter( 'x_enqueue_parent_stylesheet', '__return_true' );
    

    This line of code is necessary, you may had removed it accidentally.

    #2 I found the code causing the issue under /waterstreetgallery.co.uk/wp-content/themes/x-child/framework/views/integrity :

    <?php
    
    // =============================================================================
    // VIEWS/INTEGRITY/CONTENT.PHP
    // -----------------------------------------------------------------------------
    // Standard post output for Integrity.
    // =============================================================================
    
    ?>
    
    <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
      <div class="entry-featured">
        <?php x_featured_image(); ?>
      </div>
      <div class="entry-wrap">
        <?php x_get_view( 'integrity', '_content', 'post-header' ); ?>
        <?php x_get_view( 'global', '_content' ); ?>
      </div>
      <?php x_get_view( 'integrity', '_content', 'post-footer' ); ?>
    </article>
    // Get Featured Image URL
    // =============================================================================
    
    if ( ! function_exists( 'x_get_featured_image_url' ) ) :
      function x_get_featured_image_url( $size = 'full' ) {
    
        $featured_image     = wp_get_attachment_image_src( get_post_thumbnail_id(), array( 300, 212 ) );
        $featured_image_url = $featured_image[0];
    
        return $featured_image_url;
    
      }
    endif;

    I went ahead and removed the code. Now your site is working fine again.

    Hope it helps.

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