Override content-portfolio.php [including files into Child Theme]

edited November 2016 in Portfolio
Hi,
I am able to override the below in the theme - 

/public_html/wp-content/themes/betheme-child/includes/content-single-portfolio.php

but not - 

/public_html/wp-content/themes/betheme-child/includes/content-portfolio.php

Any ideas would be great, thanks. 


Comments

  • Hi,

    we don't know what you do exactly but if you try to upload this file into child theme, it won't work because child theme does not allow to upload own files. More information about this you can read on http://forum.muffingroup.com/betheme/discussion/3128/theme-shortcodes-php-doesn-t-work-in-betheme-child and also you should check wordpress documentation https://codex.wordpress.org/Child_Themes

    Thanks!
  • Hi,

    I am having the exact same problem as EngineRoomWeb regarding /betheme-child/includes/content-portfolio.php. I understand your comment about the complexities of modifying theme shortcodes in the child theme--that makes sense -- but is it related to content-portfolio.php? I want to be able to add some additional values to the content-portfolio.php page. 

    Thanks!
  • @vickeryhill Yes, this is exactly the same situation. If you will check the link to codex wordpress we sent above, you will realize that child theme works only with 2 files: style.css and functions.php file and all changes need to be done inside those files only.
  • edited November 2016
    If you read that same page that you linked to in the Codex, there's a section titled "Templates" that explains what we are trying to do.

    It works with many of the files (I have a custom header.php and single.php in my child theme).

    The problem that I am experiencing is trying to override includes/content-post.php by making a copy in my child theme.
  • @CriketX Yes, we understand and the following steps is what you supposed to do.

    1. Copy include-portfolio.php to child theme directory /includes
    http://pasteboard.co/e6HxIf0z.png

    2. Edit child theme functions.php and add below line:
    require_once( get_stylesheet_directory() .'/includes/content-portfolio.php' );
    http://pasteboard.co/mKPlN5o9w.png

    This line is required because of the existence of functions in the include file.
  • Awesome!!! Thanks so much!
  • I've got an error, when trying to override the file "theme-shortcodes.php".

    Here's what I did:

    1. make a copy of includes/themes-shortcode.php inside them child-theme

    2. insert into functions.php
    require_once( get_stylesheet_directory() . '/functions/theme-shortcodes.php');

    I got the error:

    Fatal error: Call to undefined function mfn_opts_get() in wp-content/themes/betheme-child/functions/theme-shortcodes.php on line 5260
  • @fredperes We are sorry but what you ask for requires files customization what in reference to Item Support Policy is not allowed. So if you want to modify files and don't know how, you should contact with your web developer.
  • @muffingroup I know how to customize the file. But I don't want to do it in the parent theme. Want to do it in the child theme. That's my question.

    I want to customize the file "theme-shortcodes.php" usin the child theme. Is it possible? How?
  • @fredperes Yes, it is possible and it can be done exactly the way we explained above. However, if it does not work on your end, it means you did something wrong. Please understand that we can not do any exceptions and offer files customization. And this is what you exactly ask for.

    Thanks for understanding!
  • Ok, understood. Your support don't want that we customize some files. I managed using shortcodes.I like the theme a lot, but unfortunately it's clear that we have to stay locked of the options.
  • @fredperes Please understand that we can not customize your theme files and then be responsible for these customization. Such kind of support is not included into license and for all customization only website developer need to be always responsible. It's obvious that we can not do that because after that for example 5000 other people would ask for other customization and as you understand, we won't be able to handle it on our end. It's just impossible.
  • I understand. I want to make the customizations. But to do that, I asked how to use the files inside a child theme. That's it. 
  • I'm with fredperes here. We want to customize files and know how to do it, but we could use some help from you to make it as easy as using the "require_once" example, which does not work with most files (same error with mfn_opts_get()), and this could be solved if the parent-theme functions.php was better prepared for function overriding.

    Hope something can be done for this in the near future. We really love your theme, but theme extension/customization is really important for a lot of us as customers.

  • @capo_saric We have no idea what you ask for now exactly because everything about including files into child theme has been explained above and this is the only proper method to overwrite files. Theme functions, has been also properly prepared and can be overwritten inside functions.php so you must be missing something if you have a problems with functions overwriting.
Sign In or Register to comment.