Forum: F.A.Q

This forum is closed for new topics. However, you can still search for a solution in the old topics. For technical support and general questions related to GEO my WP plugin and its core add-ons please use the support forum.

Update Safe Changes to Template Files

Home Forums F.A.Q Update Safe Changes to Template Files

Tagged: 

This topic contains 6 replies, has 4 voices, and was last updated by  Matthew Corsi 3 months, 3 weeks ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #33914

    Matthew Corsi
    Participant

    Hello.

    I was wondering if there was a way to make changes to the template files that will not be erased the next time the plugin is updated. In essence, what is the best way to go about customizing the results and search template files?

    So far I’ve been very impressed with the plugin, great stuff!

    Thanks,
    Matt

    #33917

    Eyal Fitoussi
    Keymaster

    Thank you, Matthew.
    There is actually a simple way to keep your changes that I haven’t covered in the documentation yet.

    You can use your theme or child theme folder to save your modified template files using the steps below (for example let say you are using “twenty twelve” theme):

    1)Go to your theme or child theme folder and create a folder named geo-my-wp.

    …/wp-content/themes/twentytwelve/geo-my-wp/

    2)Within geo-my-wp folder you can create another folder named “posts-locator” if you are using the Posts Locator core extension and/or “members-locator” if you are using Members Locator extensions:

    …/wp-content/themes/twentytwelve/geo-my-wp/posts-locator/
    …/wp-content/themes/twentytwelve/geo-my-wp/members-locator/

    3) within each of those folders you can create two more folder: “search-forms” to place your search form custom template file search and/or “search-results” for custom search results template files.

    …/wp-content/themes/twentytwelve/geo-my-wp/posts-locator/search-forms/
    …/wp-content/themes/twentytwelve/geo-my-wp/posts-locator/search-results/

    4) Into each of the folders above you can copy-paste, from geo-my-wp core plugin folder, the search form or search results template folders that you would like to modify ( or create one from scratch ). Then you can modify the PHP and CSS files of your custom templates files.

    so for example if you are modifying the ‘default’ search results template file of the Posts Locator extension, you will have something like:

    …/wp-content/themes/twentytwelve/geo-my-wp/posts-locator/search-results/default/content.php
    …/wp-content/themes/twentytwelve/geo-my-wp/posts-locator/search-results/default/css/style.css

    this is pretty much the same structure of folders that it comes with the core plugin.

    once you create your custom template file this way, you will be able to select it in GEO my WP form editor in the “Search form template” and “Results template” settings.

    hope I did not confuse you.

    the attached image is a screenshot of my local site:

    • This reply was modified 9 months, 2 weeks ago by  Eyal Fitoussi.
    • This reply was modified 9 months, 2 weeks ago by  Eyal Fitoussi.
    • This reply was modified 9 months, 2 weeks ago by  Eyal Fitoussi.
    #33916

    I was able to get the custom results template to work at the following path
    wp-content/themes/MyChildTheme/geo-my-wp/posts/search-results/myDirName/results.php

    Following the same logic I cannot get my custom search form template to display
    I’ve tried the following file path name combinations. What am I missing?

    wp-content/themes/MyChildTheme/geo-my-wp/posts/search-forms/myCustomDirName/search-form.php

    wp-content/themes/MyChildTheme/geo-my-wp/posts/search-forms/default/search-form.php

    wp-content/themes/MyChildTheme/geo-my-wp/posts/search-forms/search-form.php

    #33915

    Eyal Fitoussi
    Keymaster

    Hi Nick,
    The current version of Support does not support the custom search form template files but only available as part of the Premimum Settings add-on.
    However, the feature will most likely be added to the coming update of Support.
    Which , I already have a first beta ready if you’d like to test.

    #53060

    Josh Carey
    Participant

    Hi Eyal,

    I’m trying to make some tweaks to the “Current Location” css and I followed the above formula to try to create a “future-proof” file. But it doesn’t seem to be working.

    The paths that I’ve tried:
    MyTheme > geo-my-wp > current-location > assets > css > gmw-cl-style.css
    MyTheme > geo-my-wp > plugins > current-location > assets > css > gmw-cl-style.css

    Also, when disabling the css file (by renaming the file to xgmw-cl-style.css) in the default plugin add-on location, it just breaks, and doesn’t try to get my customized file at either of those locations.

    Can you point me in the right direction?

Viewing 5 posts - 1 through 5 (of 5 total)

The topic ‘Update Safe Changes to Template Files’ is closed to new replies.