MicrostockGroup

Microstock Photography Forum - General => Symbiostock => Symbiostock - Technical Support => Topic started by: GeoPappas on July 15, 2013, 11:34

Title: Any Way to Modify Symbiostock Files Below Main Theme Directory?
Post by: GeoPappas on July 15, 2013, 11:34
I have had success in copying a file from the main Symbiostock Theme (webroot/wp-content/themes/symbiostock) to the Symbiostock-child Theme (webroot/wp-content/themes/symbiostock-child) and then modifying the file.

But now I am trying to customize files that are below the main theme directory (such as webroot/wp-content/themes/symbiostock/inc) and I am not having success.

For example, I am trying to customize the file "rf-custom-post-functions.php" in the webroot/wp-content/themes/symbiostock/inc folder.  I have created an "inc" directory under webroot/wp-content/themes/symbiostock-child and have copied the file there, but any changes that I make are not working.

Does anyone know if it is possible to modify a file that is below the main Symbiostock Theme directory?

And if so, how?
Title: Re: Any Way to Modify Symbiostock Files Below Main Theme Directory?
Post by: Kerioak~Christine on July 15, 2013, 12:01
No idea what you are trying to do but I think you have to do something to all the files that the file you are working on calls upon.   Unless you know what you are doing it is very easy to break Symbiostock if you start changing things in the php files  <says she, wandering off and innocently whistling as if she had never done it >
Title: Re: Any Way to Modify Symbiostock Files Below Main Theme Directory?
Post by: Amanda_K on July 15, 2013, 12:44
A couple others have asked about this and I think Leo said he was going to make it possible in a future version by making things pluggable, so we can modify certain things in that folder. (I know I keep making small tweaks to the cart page myself) I'll see if I can find the thread, with so much going on I may have missed that change if it's already been made.
Title: Re: Any Way to Modify Symbiostock Files Below Main Theme Directory?
Post by: GeoPappas on July 15, 2013, 13:03
OK, I think that I figured it out.

I copied the following line in functions.php from the parent theme to the child theme and it now works:

     require_once('inc/rf-custom-post-functions.php');

I'm not sure if that is totally correct, but it seems to be working for now.

Hopefully someone can either confirm or deny that this is the correct way to do this.
Title: Re: Any Way to Modify Symbiostock Files Below Main Theme Directory?
Post by: Amanda_K on July 15, 2013, 13:09
That is the correct way and your code looks right. It wasn't working in earlier versions so it must be fixed, awesome!
Title: Re: Any Way to Modify Symbiostock Files Below Main Theme Directory?
Post by: GeoPappas on July 15, 2013, 14:06
Well, that doesn't seem to be the solution.  :-[

It works for a while, but then after a few minutes I get the following error (and nothing works after that):

Fatal error: Cannot redeclare symbiostock_image_manager_register() (previously declared in /home/content/23/11422623/html/wp-content/themes/symbiostock-child/inc/rf-custom-post-functions.php:9) in /home/content/23/11422623/html/wp-content/themes/symbiostock/inc/rf-custom-post-functions.php on line 99
Title: Re: Any Way to Modify Symbiostock Files Below Main Theme Directory?
Post by: Amanda_K on July 15, 2013, 14:23
Hmm I haven't I altered that specific file, can you share what changes you are trying to make with it?  Or did you copy it unaltered into your child theme?
Title: Re: Any Way to Modify Symbiostock Files Below Main Theme Directory?
Post by: GeoPappas on July 15, 2013, 16:12
Hmm I haven't I altered that specific file, can you share what changes you are trying to make with it?  Or did you copy it unaltered into your child theme?

At first, I copied the entire rf-custom-post-functions.php file over and made some modifications to the one in the child theme, but that alone didn't do anything.  Hence, this thread was created.

I then made the change listed above to the empty functions.php file in the child theme and that worked for about 5-10 minutes, but then I started to receive the error message listed above.

I then tried to change the line in the functions.php to:

     require('inc/rf-custom-post-functions.php'); (instead of require-once)

But that does the same thing - it works for about 5-10 minutes and then throws the same error listed above.

I have also tried to ONLY include the changed functions in the child-theme rf-custom-post-functions.php file that I modified, but I still get the same results.

I have googled this issue for hours and haven't found a solution.  I'm sure there is one, I just don't know what it is yet.

Thanks for your help.
Title: Re: Any Way to Modify Symbiostock Files Below Main Theme Directory?
Post by: GeoPappas on July 16, 2013, 09:02
I would appreciate if someone could test this out from their side.  This way I can tell if the issue is specific to my setup, host (GoDaddy), etc.

The requested changes below shouldn't cause any issues to your website at all and customers will not be able to see these changes (since they will show up on the WordPress Admin backend).

Please try the following:

You can always back out any of these changes at a later point if you want.

In my case, it didn't work, but I am wondering if this might be something specific to my setup, host (GoDaddy), etc.

I appreciate any help that one can offer.
Title: Re: Any Way to Modify Symbiostock Files Below Main Theme Directory?
Post by: Kerioak~Christine on July 16, 2013, 10:47
Does this do anything to the customer side of the site or just change the name where only the site owner can see it?  I cannot work out exactly what you are trying to achieve
Title: Re: Any Way to Modify Symbiostock Files Below Main Theme Directory?
Post by: GeoPappas on July 16, 2013, 12:56
Does this do anything to the customer side of the site or just change the name where only the site owner can see it?  I cannot work out exactly what you are trying to achieve

As I stated above, it doesn't change anything on the customer side.  It only changes something that the site owner can see.  I figured if I asked someone to test something that the customer would see then I wouldn't get many takers, so that is why I am doing something simple like this that won't affect the customer side.

I cannot work out exactly what you are trying to achieve

I am trying to figure out how to customize the child theme when files are below the main theme folder (wp-content/themes/symbiostock-child).  As I stated above, changes made to files in the main theme folder seem to work fine, but changes made to folders below the main theme folder don't.
Title: Re: Any Way to Modify Symbiostock Files Below Main Theme Directory?
Post by: Amanda_K on July 16, 2013, 13:20
Nope, it's not just you, I'm on Bluehost.  I tried it and got:

Fatal error: Cannot redeclare symbiostock_image_manager_register() (previously declared in /home/cartoo11/public_html/wp-content/themes/symbiostock-child/inc/rf-custom-post-functions.php:9) in [...]public_html/wp-content/themes/symbiostock/inc/rf-custom-post-functions.php on line 99

I did notice that rf-custom-post-functions.php has two calls to included classes that may cause issues.  I'm going to test adding them and do some research.
Title: Re: Any Way to Modify Symbiostock Files Below Main Theme Directory?
Post by: GeoPappas on July 16, 2013, 13:48
Nope, it's not just you, I'm on Bluehost.  I tried it and got:

Fatal error: Cannot redeclare symbiostock_image_manager_register() (previously declared in /home/cartoo11/public_html/wp-content/themes/symbiostock-child/inc/rf-custom-post-functions.php:9) in [...]public_html/wp-content/themes/symbiostock/inc/rf-custom-post-functions.php on line 99

I did notice that rf-custom-post-functions.php has two calls to included classes that may cause issues.  I'm going to test adding them and do some research.

Amanda_K:

Thanks a bunch.  Now I know it's not just me.  Hopefully I can figure this out, because I would like to customize quite a few things.
Title: Re: Any Way to Modify Symbiostock Files Below Main Theme Directory?
Post by: GeoPappas on July 16, 2013, 13:50
Nope, it's not just you, I'm on Bluehost.  I tried it and got:

Fatal error: Cannot redeclare symbiostock_image_manager_register() (previously declared in /home/cartoo11/public_html/wp-content/themes/symbiostock-child/inc/rf-custom-post-functions.php:9) in [...]public_html/wp-content/themes/symbiostock/inc/rf-custom-post-functions.php on line 99

I did notice that rf-custom-post-functions.php has two calls to included classes that may cause issues.  I'm going to test adding them and do some research.

Amanda_K:

Thanks a bunch.  Now I know it's not just me.  Hopefully I can figure this out, because I would like to customize quite a few things.

My intuition tells me that it is how the function symbiostock_image_manager_register is called, rather than what functions it calls (but I am a novice at PHP & WordPress, so you are probably correct).