Popular Post View Markup

This topic contains 14 replies, has 3 voices, and was last updated by  Stiofan O’Connor 10 years, 5 months ago.

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

Open Support Ticket
  • Author
    Posts
  • #18380

    execfro
    Buyer
    Post count: 80

    Is there a way to modify the HTML markup of the Popular Post View widget? I really only need the title of my locations and I’d rather not have to resort to using

    display: none;

    .

    #18399

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    Hello,

    A quick solution would be to just copy the whole widget code to your child theme function.php and rename it, that way you will be abel to change any aspect you want.

    Thanks,

    Stiofan

    #18461

    execfro
    Buyer
    Post count: 80

    Can you be little more specific about what code to copy? There’s quite a few functions in the geodirectoy_popular_widget.php file so I’m not sure if you’re referring to any specific function or if I just have to copy the entire geodir_popular_post_category class.

    #18466

    execfro
    Buyer
    Post count: 80

    I tried copying and renaming the geodir_popular_postview class as that seems to have the function with the markup, but nothing changes on the frontend and the new widget doesn’t display on the backend.

    #18473

    execfro
    Buyer
    Post count: 80

    I seem to have it working now.

    #18483

    Paolo
    Site Admin
    Post count: 31211

    excellent 🙂

    #18504

    execfro
    Buyer
    Post count: 80

    Is there a way to sort these alphabetically? Currently it only has sorting by latest, featured, review, rating and random.

    #18588

    Paolo
    Site Admin
    Post count: 31211

    Hi,

    yes you can, there is also Title. See image attached.

    Thx

    #18595

    execfro
    Buyer
    Post count: 80

    This only seems to work when I’m in the listing-listview.php template. Doesn’t work though when I use the Popular Post View widget. I am using a modified version of it, but the only thing I changed was the HTML markup.

    #18641

    Paolo
    Site Admin
    Post count: 31211

    Gotcha, no I don’t think the popual post view widget offers alphabetc sorting.

    If you already customized the markup, you should be able to also add the new sorting.

    I haven’t tested it, but simply adding the “title” option in the widget list_sort settings should work.

    In the orginal file (geodirectory_popular_widget.php) would be around line 472

    Let us know,

    #18642

    execfro
    Buyer
    Post count: 80

    I tried adding

    <option <?php if($list_sort == 'title'){ echo 'selected="selected"'; } ?> value="title"><?php _e('Title',GEODIRECTORY_TEXTDOMAIN); ?></option>

    but it didn’t work.

    #18650

    Paolo
    Site Admin
    Post count: 31211

    I’ve flagged this for Stiofan.

    Thx for your patience.

    #18689

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    I have not tested but i believe if you use the same code u tried but set the value to blank it should work value=””

    Let me know.

    Stiofan

    #18736

    execfro
    Buyer
    Post count: 80

    That didn’t seem to work either.

    #18811

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    OK we have actually changed the way the query is run in the next version to avoid colflicts, as such i have added the option to sort by a-z by default.

    Thanks,

    Stiofan

Viewing 15 posts - 1 through 15 (of 15 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