So, yes, WP can be quite a mess, more so in complicated themes. Some of it is just experience and chewing through sources.
There are, however, several things that can help to determine what is happening via code:
- Dumping
get_included_files()
will get you all PHP files loaded up to that point. It’s messy, but sometimes it’s what it takes. - There are plugins like What The File that will give a little more now picture of template files involved.
- You can dump
wp_debug_backtrace_summary()
to see execution stack to a specific point in code. - Sometimes hooks are more important than files, you can use helpers like R_Debug to dump live hooks execution and see what fires.
Related Posts:
- Does the functions.php file ever get called during an AJAX call? Debug AJAX
- Is it possible to display the admin bar while in the Theme Customizer?
- wp_enqueue_scripts not called on search page?
- Theme Check: Could not find post_class
- Unhook jQuery from WooCommerce via `functions.php`? [closed]
- Using $post->post_name in body id causing error: Trying to get property of non-object
- Should all references to a text domain be to my current theme?
- WordPress 6.x / PHP 8.x deprecated warnings in development environment
- How to debug theme (Theme is causing pages to have no style or HTML section)
- Undefined index: debuging error for theme option template snippet
- My wordpress site memory exhausted more than 1GB trying to debug with default
- How can I get page slug
- wp_nav_menu(), how to change class?
- Add custom classes to anchor in wp_nav_menu
- Upgrade from 5.0.4 to 5.1.1 causes $theme to be null
- Is there a way to set the order of wp_footer hooked functions?
- How to alter the text of the post “Excerpt” box label in WordPress post editor?
- How can you develop on a live WordPress installation that is using W3 Total Cache? [closed]
- Why is styling comments so complex?
- Add a notice to users upon first login to the admin area
- How to Auto Approve Comments on a Specific Page?
- How to deploy a new theme/theme options from staging to production site
- How do you enqueue script tags for ReactDOM in WordPress’ functions.php?
- How do I get gallery thumbnail URL and change the default thumbnail size?
- Can you filter posts by meta key with the getEntitityRecords selector?
- Responsive class to all the images in the content
- add_theme_support( ‘custom-header’ ) does not add option menu in dashboard
- WordPress Errors in generated by theme check plugin [closed]
- Upgrading a custom theme through the Dashboard
- how to make a child theme replace functions in different php files that are loaded throu require_once
- How can I customize wp_footer, where is the code that controls what this function does?
- How WordPress converts URL to $query_string
- More than one meta field in a single meta box?
- how can I remove the sidebar from my wp homepage [closed]
- How to develop child theme for thesis
- 2 differen’t menus and it’s using same items in both
- “add_theme_support” for custom footer color?
- Why is the post type on the search result page random?
- Highlight “Show all” item in wp_list_categories
- Attach media to multiple posts
- get_option in header.php not returning value from customizer
- What happens to child theme if I change to new version of parent theme?
- Internal error 500 accessing Theme > Customize
- Save Widget State Between Theme Swaps?
- Theme Development: Starter Content after hook
- Single translation for many locales
- Display theme layouts [closed]
- Is accessing theme and using customizer GPL distribution?
- Custom page template with custom fields
- Underscore Based Theme File Permissions in Git
- How do i place same widgets multiple time by default on theme activation?
- Getting php_network_getaddress error : No such host is known?
- HTML added to editor when deleting shortcodes in Chrome browser
- Combining CSS files into a single cached one
- How to set a page as homepage in stead of the newspages?
- WordPress Theme Validator?
- Get the amount of posts on a given page
- How do I use a color from theme options?
- I used single quote to design HTML of my WordPress blog. Now site redirects to index.php everytime than page.php or single.php
- Is there any way to register custom background images like header images?
- How to make javascript work on theme options page
- Second menu has the first menu ID
- How to include a file only on dashboard widgets page?
- WordPress: Allowed Memory Size Exhausted – After Moving from Dev to Live [closed]
- What exactly is “wordpress theming”? [closed]
- Present Color Schemes to Clients
- WP_Query $gallerypage->the_post() giving Undefined offset: 0
- How do I conditionally defer scripts based on the page name?
- Do I need to re-import Susy to work with it in a child theme? [closed]
- Valid SQL query not returning results
- Is it possible to have a Theme with built-in physical page files?
- header, stylesheet not being read
- first excerpt fine, subsequent post excerpts shift to the right instead of displaying vertically [closed]
- iPad WordPress theme?
- Adding link post format to theme and permalink to rss feed
- List categories of a post hierarchically?
- Custom Post Types set up, how do I style the main slug page?
- What are the permalinks options for “Category” base and removing it?
- Designing a custom archive.php inspired by the Autofocus theme
- Is a site with 1,500 pages, (1000 of which are E-Commerce Pages) Too Big to Migrate to WordPress?
- How to get blog-id of an MU site from functions.php
- How to register dynamic settings in WordPress Customizer?
- How to add audio files to audio player in WordPress custom theme?
- Does single webpage do not need navigation to create a slug in permalink?
- WordPress theme doesn’t read my translations from pt_BR.po file
- Data Validation & Sanitization for Big HTML Blocks
- How to get full native language instead of iso?
- Move the social media icons to the left of a WordPress nav menu for Soledad child Theme
- Two instances of the theme folder in the URL
- Next post in category
- Horizontal Navigation
- Custom image size doesn’t work
- Paginated WP_Query doesn’t return 404’s, even when posts don’t exist
- How to assign the default file at “Appearance > Editor”?
- Not Found when using activity stream as front page with BuddyPress
- Setting different CSS for all pages except home.php
- load src of images that attachs in wordpress’s post
- Add Field To All Pages
- Creating custom function in wordpress to return data from database
- How customizable is a self-hosted WordPress blog compared to a Blogger blog?