Skip to content
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
Closed

Load Template WordPress object for a custom template #101

jmslbam opened this issue Apr 3, 2018 · 2 comments
Assignees
Milestone

Comments

@jmslbam
Copy link
Contributor

@jmslbam 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
Copy link
Contributor Author

@jmslbam jmslbam commented Apr 3, 2018

Closing #38 as a duplicate

@jmslbam
Copy link
Contributor Author

@jmslbam jmslbam commented Jul 12, 2018

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

Successfully merging a pull request may close this issue.

None yet
2 participants