Listing Detail Page Mixed Up

This topic contains 16 replies, has 3 voices, and was last updated by  Stiofan O’Connor 6 years, 12 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #379753

    Patrick
    Lifetime Member
    Post count: 86

    I’ll ask them to fix. Thanks for debugging. Where is the tip jar?

    I liked how it showed the previous/next post title, but for GeoDirectory I didn’t like Next Post | Previous Post, wasn’t useful. I couldn’t figure out fixing the issue so I commented out the contents of the function. Read below.

    Note: If anyone has this problem the badgeos/content-filters.php contains the culprit code. The function is ‘badgeos_generate_post_link_by_post_id’.

    Really the function that calls this one messes up as it seems to run another function first that looks like it would check if the post is a badgeos achievement or not.

    I’m not sure how to fix the code so I commented it out.

    
    
    /**
     * Generate the post link based on custom post object
     *
     * @param $link
     * @return string
     */
    function badgeos_generate_post_link_by_post_id( $post_id , $rel) {
    
    	global $post;
    
    	if(!empty($post_id))
    		$post = get_post($post_id);
    
        //Title of the post
    	$title = get_the_title( $post->ID );
    
    	if ( empty( $post->post_title ) && $rel == 'next')
    		$title = __( 'Next Post' );
    
    	if ( empty( $post->post_title ) && $rel == 'prev')
    		$title = __( 'Previous Post' );
    
    	$rel =  ($rel == 'prev') ? 'prev' : 'next';
    
    	$nav_prev = ($rel == 'prev') ? '<span class="meta-nav">←</span> ' : '';
    	$nav_next = ($rel == 'next') ? ' <span class="meta-nav">→</span>' : '';
    
    	//Build link
    	$link = '<a href="' . get_permalink( $post ) . '" rel="'.$rel.'">' . $nav_prev . $title . $nav_next. '</a>';
    
    	return $link;
    
    }
    #379842

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    Thanks for spotting and reporting, i suspect just commenting out the “global $post;” line would fix it?

    Stiofan

Viewing 2 posts - 16 through 17 (of 17 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket