• NorCalAl

    (@norcalal)


    Greetings – I wanted to add a widget to the Layers theme that displays a CPT I created. It was simple enough when I modified the actual theme: add a line to the init.php in widgets folder and copy the post.php to incidents.php. Obviously I also changed all the proper references within the incidents.php to point to my new CPT.

    After the first update wiped out my changes, I quickly made/activated a child theme. No problems except I’m not sure how to get it to realize I created the new widget. I know I’m supposed to link to it… but that’s where my knowledge ends.

    I’ve seen the references to the require_once() but I’m unsure what should follow – and where the line should exist. I’ve seen some examples and I’m willing to experiment with the function itself to get it to work – provided I can learn where the call is supposed to exist.

    edit: I should clarify that I need to include both the modified init.php and the incidents.php, which exist in separate folders. Since I’m on the subject – if there are changes you make to a file in the parent theme (like the init.php in this case, where only one line is added), how, without copying the entire file (which could be updated) can you add the few lines you need?

  • The topic ‘[theme: layers] How do I "link to" a new widget created in child theme’ is closed to new replies.