Custom Theme, fastest route

This topic contains 3 replies, has 3 voices, and was last updated by  Paolo 9 years, 10 months ago.

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

Open Support Ticket
  • Author
    Posts
  • #39936

    tringwebdesign
    Expired Member
    Post count: 34

    What’s the quickest way to get a custom template working alongside this plugin? So much of the inner workings of it aren’t exposed i’m finding it hard to modify its output, by this I mean it’s reliance on filters, actions and virtual pages. CSS is great, but it can’t modify the html output.

    What would be great is a skeleton setup (no styling, just the raw output) where I can then wrap whatever sillyness layouts have been provided to me.

    Sorry, bit of a rant.

    #39939

    Simone
    Expired Member
    Post count: 3515

    Hello, the best way to start is having a read at the documentation for the theme compatibility,
    http://docs.wpgeodirectory.com/how-to-build-your-own-theme-compatibility-plugin/

    and here, it still under construction but it gets you an idea on filter hooks etc..

    http://docs.wpgeodirectory.com/codex_project/geodirectory/

    If you need something in the specific, you can ask and we’ll do our best to help you out

    #39940

    Paolo
    Site Admin
    Post count: 31211

    Hi,

    Using Theme COmpatibility screen:

    Options here allow you to change the wrappers and make any theme compatible

    Using Filters:

    There are several filters throughout the code to hook into targeted part of the output of all pages: http://docs.wpgeodirectory.com/codex_project/geodirectory_filters/

    Actions:

    Each template is broken down in several actions.

    For each do_action, you will find a corresponding create_action in geodirectory_template_actions.php

    In the create_action you will find the name of the function that is responsible for that part of the output.

    If for example you want to modify the output of the listings/category pages you will open geodirectory-templates/geodir-listing.php and see that the action we need is :

    do_action('geodir_listings_content');

    we will search for geodir_listings_content in geodirectory_template_actions.php which will bring up:

    
    
    add_action('geodir_listings_content', 'geodir_action_listings_content', 10);
    

    on line 1786

    Now you have the name of the function: geodir_action_listings_content (which is normally few lines below, like in this case on line 1792).

    
    
    function geodir_action_listings_content()
    { //function here }
    

    All you have to do now is :

    1) copy the entire function in your active theme functions.php
    2) rename the function to something like : my_geodir_action_listings_content
    3) edit the function as needed
    4) remove the original action :

    remove_action('geodir_listings_content', 'geodir_action_listings_content', 10);

    5) add the action back calling your customized function:

    add_action('geodir_listings_content', 'my_geodir_action_listings_content', 10);

    If you are developing a custom theme feel free to add Stiofan to skype for advise.

    #39941

    Paolo
    Site Admin
    Post count: 31211
    This reply has been marked as private.
Viewing 4 posts - 1 through 4 (of 4 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