Issue with get_post_info v2

This topic contains 12 replies, has 4 voices, and was last updated by  Emlyn Jones 5 years, 9 months ago.

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

Open Support Ticket
  • Author
    Posts
  • #494460

    Emlyn Jones
    Full Member
    Post count: 32

    Hi Guys,

    I am having issues with using geodir_get_post_info($post_id); in my code.

    When I loop through all locations and collate the information ready to output to a CSV, It only returns 25 (there should be 92 in total).

    I will paste the code in a separate post, as well as login details that may be useful.

    Many thanks,

    Emlyn

    #494461

    Emlyn Jones
    Full Member
    Post count: 32
    This reply has been marked as private.
    #494462

    Emlyn Jones
    Full Member
    Post count: 32
    This reply has been marked as private.
    #494464

    Emlyn Jones
    Full Member
    Post count: 32
    This reply has been marked as private.
    #494466

    Emlyn Jones
    Full Member
    Post count: 32
    This reply has been marked as private.
    #494484

    Kor
    Moderator
    Post count: 16516

    Hi Emlyn Jones,

    Thanks for your post. I will forward this to a developer.

    #494488

    Emlyn Jones
    Full Member
    Post count: 32

    Thanks Kor!

    E

    #494518

    Alex Rollin
    Moderator
    Post count: 27815

    Why not use GD Loop or GD Listings to do this?

    #494538

    Emlyn Jones
    Full Member
    Post count: 32

    Hi Alex,

    Thanks for the reply.

    Can I confirm – my aim is not to output all the care homes onto the page, but to get all the imformation, calculate some statistics, and to store in a CPT as a snapshot for reporting purposes.

    I have had a look at the documentation and can only find what you’re referring to as shortcodes – are they also available as functions…?

    Do you have a link to the docs for those to see if they would work for my use case?

    Many thanks,

    Emlyn

    #494573

    Alex Rollin
    Moderator
    Post count: 27815

    Thanks, the developers will take that into consideration and try to advise you.

    #494578

    Emlyn Jones
    Full Member
    Post count: 32

    Thanks Alex!

    E

    #494610

    Kiran
    Moderator
    Post count: 7069

    Hello Emlyn,

    By default WP Query returns 25 results on first page. You need to add posts_per_page parameter in query args.

    Try following args.

    
    
    $args = array(
    	'post_type' => 'gd_place',
    	'post_status'=>'publish',
    	'posts_per_page' => -1
    );

    Regards,
    Kiran

    #494832

    Emlyn Jones
    Full Member
    Post count: 32

    Hi Kiran,

    That’s great – so simple! That’s fixed that problem, but unfortunately raised another one.

    I will investigate to see if there’s something I can figure out but may be back in touch.

    Many thanks,

    Emlyn

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