New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Load Template WordPress object for a custom template #101

Closed
jmslbam opened this Issue Apr 3, 2018 · 2 comments

Comments

Projects
None yet
2 participants
@jmslbam
Copy link
Contributor

jmslbam commented Apr 3, 2018

What

when using a custom CPT template, it would be nice to have a accompanying WordPress object to be automatically load.

template-custom-landing-page.twig = template
template_custom_landing_page.php = WordPress Object

How to test

wordpress-objects/template_jaime.php

<?php

class template_jaime extends Clarkson_Object {
    public function get_title(){
        return "jaime - " . parent::get_title();
    }
}

templates/template-jaime.twig

{% extends "layouts/full-width.twig" %}

{% block content %}
    <p>This is the content of template-jaime.twig</p>
    {% include 'partials/content.twig' %}
{% endblock %}
@jmslbam

This comment has been minimized.

Copy link
Contributor Author

jmslbam commented Apr 3, 2018

Closing #38 as a duplicate

@jmslbam

This comment has been minimized.

Copy link
Contributor Author

jmslbam commented Jul 12, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment