Still Having problems setting description length

This topic contains 16 replies, has 3 voices, and was last updated by  purpleedge 9 years, 10 months ago.

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

Open Support Ticket
  • Author
    Posts
  • #6181

    nasc
    Expired Member
    Post count: 235

    Hi,

    @Vikas, I don’t want to beat a dead horse but after following your instructions I still have not been able to solve this Description length issue.

    Per another thread from the other day you had said:

    In new updates the description length options have been provided in widget setting, so plz set it as per ur wish.
    Description length is controlled by 3 parameters in hierarchical.
    1. Option in widget setting
    2. Geodirectory > Design > Listing tab > Description word limit
    3. WordPress default excerpt lenght

    so if 1st is not defined then 2nd is used and so on.

    1. I am not using a widget for showing the listings
    2. I have tried using 10 words and 100 words (just for testing) in
    Design>listing tab> word limit— No effect

    Whatever I do, the length varies. I just want to keep the description the
    same length as my photos when showing the listings of a particular CPT.

    I just go to my top menu, select Full,basic,affiliate or channel partner and
    view my listings.

    My pictures are just temporary right now, usually only 150×150, so I created a test listing for a basic member with a 960×425 photo for our golf tournament just in case the description is OK and the photos have been too small. That apparently wasn’t the case.
    Site credentials if needed:

    Thanks for your help

    #6182

    nasc
    Expired Member
    Post count: 235
    This reply has been marked as private.
    #6218

    Vikas
    Full Member
    Post count: 1128

    Hi,
    As a hot fix.
    Plz search ‘function geodir_excerpt_length’ in ur geodirectory > geodirectory-functions > post_functions.php, it should be around at line no. 1889.

    Replace that function with below code.

    
    
    
    function geodir_excerpt_length($length)
    {
    	global $wp_query;
    	if(isset($wp_query->query_vars['is_geodir_loop']) && $wp_query->query_vars['is_geodir_loop'] && get_option('geodir_desc_word_limit'))
    		$length = get_option('geodir_desc_word_limit');
    	elseif(get_query_var('excerpt_length'))
    			$length = get_query_var('excerpt_length');
    			
    	if(geodir_is_page('author') && get_option('geodir_author_desc_word_limit'))
    		$length = get_option('geodir_author_desc_word_limit');
    	
    	return $length;
    }
    

    Please advise ?

    #6219

    nasc
    Expired Member
    Post count: 235

    Thanks but that didn’t work for me.

    I did it twice to make sure. I named the old file just in case I need to put it back.

    But, that was approaching the edge of my editing capability.

    I set the length to 10 in Design/listing as a test

    #6220

    nasc
    Expired Member
    Post count: 235

    Here’s a snip of what I did,

    #6235

    Vikas
    Full Member
    Post count: 1128

    Hi,

    Send me site ftp in private reply please.

    Thanks

    #6246

    nasc
    Expired Member
    Post count: 235
    This reply has been marked as private.
    #6260

    Vikas
    Full Member
    Post count: 1128

    Hi,

    I checked and found that everything is fine at GD end, so may be its due to WP total cache plugin u have actived there. Please try to deactivate it and check.

    Thanks

    #6264

    nasc
    Expired Member
    Post count: 235

    I have completely uninstalled and no help.
    On that subject, since it may not be the cause, what do you think about
    the usefulness of that plugin. It was recommended by Hostgator on their site, not
    just from a tech.

    Should I uninstall all my plugins with the exception of GD and addons?

    #6623

    nasc
    Expired Member
    Post count: 235

    deactivated all other programs, still the same problem.

    #6817

    Vikas
    Full Member
    Post count: 1128

    Hi,

    I have fixed this issue, i found that Avada theme also has a filter on excerpt_length hook.
    I wanted to put this code

    
    
    
    add_action('init' , 'geodir_remove_excerpt_lenght_filter') ;
    function geodir_remove_excerpt_lenght_filter()
    {
        remove_filter('excerpt_length' , 'avada_excerpt_length', 999);
    }
    

    in your avada child theme functions.php file, but came to know that u are not using that, so i put it in geodirectory(core)/geodir_hook_actions.php.
    But this will get overwritten with next release because this is specific to avada theme. I will consider it as Avada theme compatibility issue and put this solution in Avada child theme later.

    Please advise ?

    #6829

    nasc
    Expired Member
    Post count: 235

    Thanks, What is the proper way to activate my child theme? Do I deactivate my current Avada theme first, then Activate the child theme. Anything I have to reconfigure after that?

    I will then place the code where it should go,

    Thanks for the effort.

    #6862

    nasc
    Expired Member
    Post count: 235

    Well, the description length works regarding the ‘read more’ coming after the
    correct number selected in ‘Design>Listings. When i chose 10 words it shows ten words, etc.

    But, The character length problem in using the GD popular post view in The GD bottom listing area is affected.I have another post concerning a problem where the character length is not correct using this GD popular post view.(Before this word count fix today) I have the character count set at 500, yet it shows about 10 words. If I change it to 800 Characters it shows about 30 words.

    If I change the word count (that you just successfully fixed) in the details>listing area, It changes the word count/ Characters in the GD Popular post.

    Thanks,

    #8733

    nasc
    Expired Member
    Post count: 235

    Sorry, still having problems with the character count in ‘gd bottom listing’. I now have your new AVADA child theme installed and I believe I placed the file correctly in the style.css file.

    I have the character count set for 2000 and it’s not even close to showing the full text.Am I doing something wrong?

    #8750

    purpleedge
    Expired Member
    Post count: 539

    GD is printing the excerpt, not the content.

    You can change the length of the excerpt by adding this to your functions.php file…

    // Change the number of words contained in an excerpt to 300
    function custom_excerpt_length( $length ) {
    return 300;
    }
    add_filter( ‘excerpt_length’, ‘custom_excerpt_length’, 999 );

    This should ensure that the number of characters in the excerpt is greater than your desired character count.

Viewing 15 posts - 1 through 15 (of 17 total)

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

Open Support Ticket