Show author on listings that are not claimed

This topic contains 16 replies, has 4 voices, and was last updated by  Paolo 8 years, 10 months ago.

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

Open Support Ticket

Tagged: 

  • Author
    Posts
  • #19987

    openmindtrips
    Expired Member
    Post count: 180

    Hi

    Is there a way to show the author of a listing in the sidebar on listings that are not yet claimed?

    Thx

    #19992

    Simone
    Expired Member
    Post count: 3515

    Hi, I’ve just created this function, add it in the functions.php file inside your child theme

    
    
     add_action( 'geodir_detail_sidebar_inside', 'geodir_before_detail_page_review_rating_claim',1 );
      function geodir_before_detail_page_review_rating_claim() {
      global $wp_query, $post;
      
      $postid = $wp_query->post->ID;
      
      
     $claimed= geodir_get_post_meta($postid,'claimed',true);
     
      if ($claimed=="1")
      {$myauthor = get_the_author();
      $myauthorlink = get_author_posts_url( get_the_author_meta( 'ID' ) ).'?post_type='.$current_posttype;
      echo '<p>Author: <a href="' .$myauthorlink . '">' . $myauthor . '</a></p>';
      
       }
      else {
         } 
    #19995

    openmindtrips
    Expired Member
    Post count: 180

    Thank you for your quick response Simone!

    i tried adding it to my child theme’s functions.php but it says that there is an error with the line

    function geodir_before_detail_page_review_rating_claim() {
    global $wp_query, $post

    Do you know what is wrong?

    #19996

    Simone
    Expired Member
    Post count: 3515

    …not helpful without knowing what’s the error 🙂

    #20006

    openmindtrips
    Expired Member
    Post count: 180

    The error is: Parse error: syntax error, unexpected $end in /var/www/openmindtrips.org/public_html/plus/wp-content/themes/geodir_Avada-Child-Theme/functions.php on line 41

    (before it said in line 23)

    I’ve attached a screen shot of the .php

    #20008

    Simone
    Expired Member
    Post count: 3515

    Add another } after the last }

    #20014

    openmindtrips
    Expired Member
    Post count: 180

    Nice, no error now – so far so good 😀 But when I press a listing it does not show the author of it anywhere in the sidebar…

    #20018

    Simone
    Expired Member
    Post count: 3515

    ops sorry, in my code just replace this

    
    
      if ($claimed=="1")
    

    with

    
    
      if ($claimed !="1")
    
    #20031

    openmindtrips
    Expired Member
    Post count: 180

    Still does not show the author even when I corrected it 🙁 Does it have something to do with the GD> listing claims > Show link to author page on listings? is set to yes?

    #20032

    Simone
    Expired Member
    Post count: 3515

    if you would give me the login details of wordpress and FTP i will check for you

    #20061

    openmindtrips
    Expired Member
    Post count: 180
    This reply has been marked as private.
    #20094

    Simone
    Expired Member
    Post count: 3515

    hi, I did not edit anything yet, I’ve checked your website and it shows the author, maybe it was your cache 🙂

    #20095

    Simone
    Expired Member
    Post count: 3515
    This reply has been marked as private.
    #20096

    openmindtrips
    Expired Member
    Post count: 180

    Oh yes you are right! I might have overlooked it, since I thought it would appear inside the box like when claimed. Sorry about that – and thank you so much for your help 🙂

    #20098

    Simone
    Expired Member
    Post count: 3515

    You’re welcome 🙂

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
20% Discount Offer
Hurry! Get your 20% discount before it expires. Get 20% Discount