mAAdhaTTah / wordpress-github-sync

A WordPress plugin to sync content with a GitHub repository (or Jekyll site)
https://wordpress.org/plugins/wp-github-sync/
GNU General Public License v3.0
613 stars 99 forks source link

GitHub Sync Directory #189

Closed mikewojtkiewicz closed 6 years ago

mikewojtkiewicz commented 6 years ago

How do I sync my WP posts to a different directory on GitHub? Currently, when I export out of WordPress, the application saves the folders to the parent directory of GitHub. But, I need all the files to save to a folder called 'Content.' I tried manipulating the wpghs_directory_published filter, but nothing I do is working. Am I using the correct filter to change this?

mikewojtkiewicz commented 6 years ago

Wow...just as I posted this I figured it out. If anyone out there needs to know how to do what my issue was, this is the code I added to the wpghs-custom-filters.php file: add_filter('wpghs_directory_published', function ($current_directory, $post_type){ return 'Content' . '/' . $current_directory . $post_type; });

The folder I need to sync on GitHub is called "Content."