Add custom post info to Enfold's masonry template

This topic contains 17 replies, has 5 voices, and was last updated by  Irth Orbits 10 years ago.

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

Open Support Ticket
  • Author
    Posts
  • #22618

    irth orbits
    Free User
    Post count: 7

    Looking to add some values saved in GeoDirectory to a theme’s template. Found where in the template is responsible but how to display specific data in the template via a hook?

    Example of the masonry rendered template attached and test site is at http://test.locallogic.ca/directory/going-out/indoor-activities/

    #22737

    Simone
    Expired Member
    Post count: 3515

    Hi, we didn’t develop Enfold, just a compatibility plugin for it. To tell a Enfold template how to output custom post types instead of regular post, sounds like a question for the Enfold Author.

    Let us know what they say, thanks.

    #22767

    irth orbits
    Free User
    Post count: 7

    Please correct me if I’m wrong, but doesn’t your plugin register global hooks that can be used willy nilly wherever we want?

    #22785

    Paolo
    Site Admin
    Post count: 31206

    It doesn’t work that way.

    Hooks allow you to modify GeoDirectory templates and extend the GeoDirectory functions.

    Not to extend/mix other themes and plugins.

    Anyway, I’ve just checked in our Enfold demo, and the Masonry element already supports custom post types by default from the advanced layout builder.

    http://dropct.com/enfold/blog/masonry-blog/

    The problem is that you won’t be able to filter the listing in any way other than just displaying them all. I don’t think it will filter locations for example.

    If you want to do that, you have to modify the masonry element, but I suspect it would be easier to turn the regular GD archive into a masonry element instead.

    Thx

    #22807

    irth orbits
    Free User
    Post count: 7

    Thanks Paolo. I understand a little better and I don’t think the filtering is an issue at this point.

    I still don’t understand how to get geoD data to display in the masonry element. For example, I’m trying to display a business address so copy the code:

    
    
    function geodir_detail_page_more_info()
                            {
                            	global $post,$preview,$post_images;
                            	ob_start() ; // Start  buffering;
                            	do_action('geodir_before_detail_page_more_info') ;
                            	if($geodir_post_detail_fields = geodir_show_listing_info()){
                            		echo $geodir_post_detail_fields;
                            	}
                            	do_action('geodir_after_detail_page_more_info') ;
    
                            	$content_html = ob_get_clean();
                            	if(trim($content_html) != '')
                            		$content_html  = '<div class="geodir-company_info geodir-details-sidebar-listing-info">' . $content_html . '</div>' ;
                            	echo $content_html = apply_filters('geodir_detail_page_more_info_html' , $content_html) ;
                            }

    from geodirectory_hooks_actions.php and drop in the masonry_entries.php and add {$content_html} right next to {$content} in $items

    I don’t know php so I’m just hacking away. Am I overthinking this? Linked is a visual of desired outcome. Thx for the assistance.

    #22865

    Paolo
    Site Admin
    Post count: 31206

    Hi,

    customization is not part of the support provided here. We can give you pointers, but we will not write the code for you.

    A fair question though, if you don’t know PHP, why did you accept a job involving PHP customizations?

    The function that you want to look at to see how the address is displayed in the sidebar would be:

    function geodir_show_listing_info that can be found in custom_fields_functions.php around line 1694.

    To display rating it will be another bit:

    listing-listview.php around line 103.

    To display a custom field you can use the regular wordpress API for it.

    Let us know how you get on.

    Thank you

    #22923

    irth orbits
    Free User
    Post count: 7

    Thanks haven’t quite got it yet. Trying to display the address, I’m using the following code

    
    
    				
    $this->loop[$key]['geo_loc'] = get_field( "geodir_show_listing_info" , $id );
    

    then in the html I call

    {$geo_loc}

    What am I missing?

    #22925

    irth orbits
    Free User
    Post count: 7

    If it helps I found this brief but closed support topic. could you just tell me what needs to be swapped in for Geo Dir? thx

    http://www.kriesi.at/support/topic/masonry_entries-php-get-custom-field-value-or-content/

    #22974

    Paolo
    Site Admin
    Post count: 31206

    Hi Irth,

    that can probably be used to get a regular wordpress custom field, not the address. The address and various other fields aren’t saved as regular custom fields. they are saved in a table called geodir_gd_place_detail.

    get_field must be an enfold function and I don’t know what it does, but in the example he’s calling a specific custom field

    get_field( "linkedin-url", $id );

    .

    you are trying to call a function instead

    get_field( "geodir_show_listing_info" , $id );

    Not knowing how that Masonry script exactly works, it is very difficult to give you a straight answer without doing it ourself, reason why we don’t provide support for customizations.

    But I’ll ask to Stiofan to have a look at this and see if he can think of any easy way to do this.

    Thanks

    #22990

    irth orbits
    Free User
    Post count: 7

    Thanks, I would want to use whichever wordpress call works. I also tried get_post and a few others without luck. is there a special $context that I would need to set?

    #23035

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    I am not exactly sure what you are trying to do here but maybe this functions would help?

    $post_details = geodir_get_post_info($post_id);

    you shoudl then be able to get all the info u need from $post_details, you can do a print_r($post_details); to print all the info contained.

    Stiofan

    #23226

    Irth Orbits
    Free User
    Post count: 5

    Thanks for that, tho I’m still not getting anything info to display. What I’m trying to do is have the Enfold theme’s masonry display the location and rating info from geoD tables.

    Here’s a link to the file in question, line ~598 is where I want to inject geoD data.. https://github.com/irthos/locallogic/blob/production/public/wp-content/themes/enfold/config-templatebuilder/avia-shortcodes/masonry_entries.php

    Appreciate the attention!

    #23303

    Paolo
    Site Admin
    Post count: 31206

    Hi Irth,

    it seems like you are looking for someone to write the code for you.

    I’m glad to move this to the Jobs section to allow you to find a developer to help you with this.

    Writing custom functions to make GD elements appear in other theme’s template goes beyond support provided here.

    Thanks

    #23355

    Irth Orbits
    Free User
    Post count: 5

    Hi Paolo, seems like you’d rather not help with a simple request on a premium plugin.

    I’m also in touch with the enfold folks but this is geoD responsibility.

    Now, I enter $items .= geodir_get_post_info($entry[‘ID’]); into line 598 of the masonry_entries.php and this displays only the number ‘0’.

    Why would it do this? Thanks for ongoing support.

    #23357

    Paolo
    Site Admin
    Post count: 31206

    Hi Irth,

    you are not asking for a simple support request, but for a customization that involves writing custom code inside the template of another product.

    Buying the premium plugin doesn’t include custom coding.

    I reiterate my offer to help you find a PHP developer to help you with this.

    Probably Jeff would be availalbe to help with this.

    Thanks

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