Tagged: review
- This topic has 4 replies, 4 voices, and was last updated 4 years, 8 months ago by
Josh Carey.
-
AuthorPosts
-
August 16, 2013 at 6:59 pm #33914
Matthew Corsi
MemberHello.
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,
MattAugust 16, 2013 at 8:03 pm #33917Eyal Fitoussi
MemberThank 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.cssthis 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:
January 24, 2014 at 1:41 am #33916nick.koonce@yardi.com
MemberI 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.phpFollowing 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
January 24, 2014 at 3:25 am #33915Eyal Fitoussi
MemberHi 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.July 5, 2016 at 10:24 am #53060Josh Carey
MemberHi 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.cssAlso, 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?
-
AuthorPosts
The topic ‘Update Safe Changes to Template Files’ is closed to new replies.