Viewing 15 posts - 61 through 75 (of 77 total)
Monique

widget most popular listing

Hello I should like to display a widget with the 5 most popular listings So i've tried "meta_key=hits&order=desc" in Custom Query But i don't get the 5 mosts hits Please can you help me Thanks

Created: July 25, 2013 at 4:31 am

  • Ian
    Ian
    January 23, 2014 at 1:07 am

    Contact me at https://webservices.cynian.net/contact/ if you need something else 🙂

  • Malgorzata
    Malgorzata
    January 23, 2014 at 2:03 am

    @Ian, you’ve change your site and logo – Nice, the Shopper Press guys should give you a visit, good offers for them on your site.

  • Alex
    Alex
    January 23, 2014 at 7:23 am

    A big thanks to Malgorzata and Richard.

    I used the widget mentioned by Malgorzata – New Website Listings
    and added the Custom Query from Richard – meta_key=hits&orderby=meta_value_num&order=desc
    Posts per page is handled by filling in How many listings to display?

  • Malgorzata
    Malgorzata
    January 23, 2014 at 2:39 pm

    happy to hear it works for you.

  • Paul
    Paul
    May 7, 2014 at 12:52 pm

    Hi,
    Firstly, thanks for this thread guys, it’s very helpful.
    I just wanted to pickup on Jennifer and Ian’s discussion, and was wondering if anyone can point me in the right direction.

    Regarding class_white_label_themes.php, I’m trying to make a modification to the general settings/display order, so that when I select “price (low-high)” then INSTEAD of sorting by price (which I have no need for in my directory setup), it sorts by PackageID instead, thus allowing me to give the people who paid more better exposure in top ranking positions within their category.

    Anyone have a quick solution, I’ve changed “price” to “packageID” in the places Jennifer and Ian were working, but no joy…
    Thanks in advance.

  • Jennifer
    Jennifer
    May 7, 2014 at 9:37 pm

    Hi Paul,

    Just changing the wording isn’t going to work because the internal code probably isn’t using “packageID” for that attribute. You should probably say what theme and version you are using. Then, maybe Ian or someone else will know. It’s probably also searchable in your database. That’s where I realized that the rating is called starrating. I’m not techie enough to help you, but hoping just to give you a couple clues that you can follow or maybe Ian can help. He has helped me again even since this thread with similar issues.

    Jennifer

  • Paul
    Paul
    May 7, 2014 at 10:11 pm

    Thanks Jennifer,
    You’re absolutely right, I should include a few details.
    My version is 6.5.2 of the Responsive Directory Theme.
    When I export my database in CSV, the only field I can find relating to the package is packageID, so that’s why I’m using that as a workaround.
    I’m pretty stumped with this one, and would appreciate any help given.
    Thanks again Jennifer.

    Regarding class_white_label_themes.php, I’m trying to make a modification to the general settings/display order, so that when I select “price (low-high)” then INSTEAD of sorting by price (which I have no need for in my directory setup), it sorts by PackageID instead, thus allowing me to give the people who paid more better exposure in top ranking positions within their category.

    Anyone have a quick solution, I’ve changed “price” to “packageID” in the places Jennifer and Ian were working, but no joy…

  • Jennifer
    Jennifer
    May 7, 2014 at 11:59 pm

    Hi Paul,

    Did you notice the several lines of code that include the term “price” inside class_white_label_themes.php? Without knowing for sure, I’d say that replacing price isn’t as good an idea as creating an extra attribute that goes along side all the others in that file. There are two places where it would need to be added, and you can find them by searching for the others, like data, price, title, rating, etc. I believe they are in the lines between 600 and 700 in that file.

    If you found PackageID in the database, it’s probably the right term.

  • Paul
    Paul
    May 8, 2014 at 11:44 am

    Thanks Jennifer. I’ve just tried that now, but I’m a little confused, does adding the extra attributes make it able to be the default sort order when a visitor arrives on the page, without clicking on the orderby options box?

  • Jennifer
    Jennifer
    May 8, 2014 at 7:45 pm

    Hi Paul,

    Back when I did this, it was version 6.1, so I don’t know if it’s changed since then, but I couldn’t get my sort by rating to work at all unless I chose the top option on the default sort order (can’t remember what it’s called atm). I alerted Mark that it was a bug, but I don’t know if he did anything, so I just settled for the built-in default.

    It is confusing, and like I said, I’m probably not able to really give you the right answers. Try Ian. He really gets this stuff. You can contact him through his cynian website.

    Jennifer

  • Paul
    Paul
    May 9, 2014 at 9:58 am

    Thanks Jennifer,
    I’ll give him a shout.
    Paul

  • Paul
    Paul
    May 9, 2014 at 12:49 pm

    Sorry about this guys, but I’ve figured out a workaround and just need a little help with the coding.
    I’m adding a line to tpl-add.php (add listing page):

    add_post_meta($POSTID, ‘price’, ‘packageID’);

    basically I want to update the price field with the packageID field value on saving the new listing. I’m not using price in my directory theme, so can use it in my default display order to sort by packageID instead.

    The only thing is I’m not good at the syntax, so they way I have it at the moment only outputs the word packageID into the price field, rather than the actual value in the field.

    I hope this makes sense guys…

  • Paul
    Paul
    May 9, 2014 at 5:12 pm

    Got it.
    I just worked out the code:
    update_post_meta($POSTID, ‘price’, $_POST[‘packageID’]);

    hope it helps someone else!
    Thanks Jennifer for all your input!
    Paul

  • Jennifer
    Jennifer
    May 9, 2014 at 7:59 pm

    Great!

Copyright © 2010-2020 PremiumPress Limited.

secure payments