Mods to mobile theme's functions.php file

Posted in: Newspaper
Post count: 34

Hi, I am using the mobile theme and it works great! I appreciate how you added a special block on the page admin to insert specific elements for the mobile pages. I am just curious about the functions.php file; I had to add a function to it so that my shortcode would work in posts displayed in the mobile theme, so I created newspaper-child/mobile/functions.php and added the code there, but it turns out I had to do it in newspaper/mobile/functions.php, which is fine except that your next update is going to wipe out my change. Is there a way to do this in the child theme so that my mods are retained following a theme update? Thanks for any guidance you can provide.

Post count: 23312

Hello Gil Poulsen,

Unfortunately, the mobile theme cannot be overwritten in the child theme, sorry! If you want to edit the functions for mobile theme, you should edit the following theme core file, like this -> https://www.screencast.com/t/WXkWK5ii6qM
I suppose that you do not understand very good how mobile theme works, right? So, please notice that this theme concept intend to display a Big Grid feature at the top of homepage which shows the posts which are included in Featured category, then will show a text which you added in Mobile Editor in Visual Composer from backend and at the very bottom of the page you will bring the Latest Articles module. Please keep in mind that the Mobile Theme do not recognize the Visual Composer shortcode and that’s why you did not get the demo style for mobile theme. So, for more information about our mobile theme, please check the documentation here -> https://forum.tagdiv.com/the-mobile-theme/ If you are unhappy with this layout, and if you want to have the similar structure with our demo mobile, you will simply turn off the mobile plugin and the theme will be automatically switched to the general responsive mobile mode.

Thanks for your understanding!

Post count: 34

Thank you, Catalin. I do fully understand how the mobile theme works, and it works great. My question was only related to whether I could preserve any changes I make to the mobile theme’s functions.php file following a theme update. Because there is a function I have created that needs to appear in posts displayed using both the “normal: and the mobile theme, I need to add that function to the mobile theme’s functions.php file. I was hoping to be able to use my child theme’s functions.php for that so my changes would not be overwritten after an update but given your response, I will just make sure to keep a backup of /mobile/functions.php so I can restore my mods after a theme update. Thanks!

Viewing 3 posts - 1 through 3 (of 3 total)
The forum ‘Newspaper’ is closed to new topics and replies.