customization - Wordpress & child themes - strategies to find out which .php to override? -
starting basic wordpress bootstrap themes i'd modify width posts , post links. more get-to-know-wp heavy duty theme creation - interested in how apply minor customizations across different themes. know each theme can kinda pick php files wants provide, know works in theme won't work in theme b.
i've done once 1 theme, other theme doesn't have same php file names.
for example, know make widget area narrower posts, want override sidebar.php:
<!-- <div id="secondary" class="widget-area col-md-4" role="complementary"> --> <div id="secondary" class="widget-area col-lg-2" role="complementary">
and modifying index.php makes left-side wider:
<!-- <section id="primary" class="content-area col-md-8"> --> <section id="primary" class="content-area col-lg-10"> <div class="tmarker">index.php</div> <!-- added this! -->
this works fine when @ root of site, index.php getting used.
however, when navigate post, to:
<div id="primary" class="content-area col-md-8">
and post area hasn't expanded. makes sense - index.php isn't used here.
how know php file getting composed post detail view can override it?
i've tried looking 'index.php' in page source, saw 1 added myself on child override.
i guess @ phps in editor , find class="content-area col-md-8"
, trial , error them till hit right one. not fun. there better ways?
could @ least dump of phps files , grep col-md-8
? i'd need text export themes.
p.s. know wordpress child customizations best done in style.css , functions.php, unless missed something, bootstrap, think need hit class
assignments bootstrap work instead.
there's lots of tips , strategies, 1 "a quick-and-dirty way":
most decent themes add class body element reflects theme template being used. if inspect body element, should able see template being used (for example page-template-default
, etc).
if theme breaks down further simple template levels, you'll have start examining code in given template(s) figure out code running, etc.
Comments
Post a Comment