Tag: rewrite rules

  • WordPress Bash Magic

    I’ve been doing a lot of bash scripting with WordPress, especially with WP CLI. Here are some snippets I found useful. All my scripts assume a standard wp-config.php with DEFINE() statements and no unusual logic structures. A rogue constant with the name DB_NAME may throw things off without some modification. Getting the Database table prefix If you…

  • Content Without Posts

    I’m going to demonstrate how to have a URL with content in WordPress that’s neither a post, page, or listing. Its contents can be anything you’d like! To do this we need to take the following steps: Add a custom query variable Add a rewrite rule that uses the new query variable On the template_redirect…

  • Getting From URL to Template

    So you load a page on a WordPress site. How did it know to load the page template? How did it know it was a page and not a category listing? Is it hardcoded somewhere? To begin with lets list out what happens, then we’ll explain each step in basic terms: .htaccess rules pass the URL…