Support » Plugin: WPAdverts - Classifieds Plugin » Author of ad would be useful in listings

  • jockelandelius

    (@jockelandelius)


    Being able to choose details in the list (Currently Date, Location and Price). Would be awesome to be able to add the author of the add. Site is a member-site with certain relevance to who posted the add.

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • mrthiemann

    (@mrthiemann)

    Hey jockelandelius,

    maybe this is what you are looking for?

    https://github.com/simpliko/wpadverts-snippets/blob/master/ads-by-author/ads-by-author.php

    Ciao, Karsten | dein-3d.com

    jockelandelius

    (@jockelandelius)

    Hi,

    This was nifty, however not what I was after. I was rather looking to have the poster visible in the rows for each ad. Basically where it sais date and location presently.

    /JL

    Plugin Author Greg Winiarski

    (@gwin)

    Hi,
    currently, the only way to display the author information in the [adverts_list] requires editing the wpadverts/templates/list-item.php template file and adding there the author information.

    Inside the list-item.php you can get the author/user object with the following code

    
    $user = get_user_by( "ID", get_post( get_the_ID() )->post_author );
    

    BTW. If you will be modifying list-item.php template file consider creating a child-template file for list-item.php file as explained here https://wpadverts.com/documentation/child-themes-and-templates/ so your changes will not be overwritten on WPAdverts update.

    Hi,
    How displaying description under title. Please, help me!

    Plugin Author Greg Winiarski

    (@gwin)

    Hi,
    do you want to do this on the ads list? If so then right now the only way to do it is to open file wpadverts/templates/list-item.php and add there on a line about 17 (depending on where you want to have it the below code)

    
    <?php echo esc_html( get_the_excerpt ( get_the_ID() ) ) ?>
    

    Please note the changes you will do in list-item.php file will be overwritten on WPAdverts update, to avoid that consider creating a child template for list-item.php file as explained here https://wpadverts.com/documentation/child-themes-and-templates/

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Author of ad would be useful in listings’ is closed to new replies.