Coder Social home page Coder Social logo

page-templater's People

Contributors

bellthomas avatar jeanpierreb avatar kadimi avatar leeb003 avatar mmcev106 avatar wpexplorer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

page-templater's Issues

Wordpress4.9 The template in my theme can not display

I have already had several template in my wp theme
when i use this plugin,the template in my theme can not display anymore
my english is poor ,can u understand what i want to express
waiting for your help thanks

Incompatible with wordpress 4.7

Have an issue on activation on line 10

Fatal error: Cannot redeclare class PageTemplater in C:\xampp\htdocs\playground\wordpress\wp-content\plugins\page-templater-master\pagetemplater.php on line 10

How to fix this?

Thanks!

Takes over search page template

If the page using custom page template through page-tempaltar comes in the search page results, the page template takes over search page template and everything is broken

Any idea why?

Extending the templater for autoloading

Nico Amarilla on autoloading in a plugin container provided a great method framework for building plugins. I've adapted it for multiple plugin fields and now for the PageTemplater. The constructor now looks like this:

    public function __construct(array $templates)
    {
        $this->templates = $templates;
...
    }

and my plugin includes this:

    $prefix = __DIR__ . DIRECTORY_SEPARATOR . 'src' . DIRECTORY_SEPARATOR . 'Templates' . DIRECTORY_SEPARATOR;
    $templates = [
         $prefix . 'member-content.php' => 'Restricted Member Content',
    ];
    $templater = new Rma\PageTemplater($templates);
    add_action('plugins_loaded', array('Rma\PageTemplater', 'get_instance'));

Edit:

The template is listed in the dropdown yet not applied. When the page is updated its template is reset to Default Template. The path is correct.

WP 4.7 break page templater

Not sure what's changed yet, but I see that 4.7 breaks the templates I had injected with page-templater into a plugin.

Template Has to be Reset With New Code Deployment

Hi! I'm picking up where another dev left off on a project and noticed he used this plugin/code. Curiously, every time I run a deployment of new code the template is dropped from the page in question and I have to go select it again. Any idea what might be going on with that? Thanks in advance!

WP4.7.1 has broken the page templater

Does anyone have any idea what it is that WP has changed to make this no longer work?

The page templates no longer appear in the page template selector of the page editor, after updating WP to v4.7.1

The actual pages created before updating Wordpress, and their customisations that use the templates do still remain, so it is still functional but, the templates no longer appear in the template selector, which makes creating new pages with the custom templates impossible.

Any ideas? I haven't been able to figure it out yet.

Cheers.

Cannot get to work. Add_action placement?

Hi.

I'm using WP 4.9.2, and am developing a plugin using the Wordpress Plugin Boilerplate. Because the Boilerplate handles all add_action statements with a helper function, I found I had to not use an array to pass the class and method. Instead of add_action( 'plugins_loaded', array( 'PageTemplater', 'get_instance' ) ); I am using: $this->loader->add_action( 'plugins_loaded', $plugin_admin, 'PageTemplater::get_instance' );

But, I'm getting an error about class hierarchy: ( ! ) Warning: call_user_func_array() expects parameter 1 to be a valid callback, class 'Home_Search_Admin' is not a subclass of 'PageTemplater' in /var/www/html/wp-includes/class-wp-hook.php on line 286

  1. Does using the array in the add_action cause something to be handled differently that how I've done things?
  2. Where does the add_action need to be placed in the plugin code (i.e., really really early)?

Allow filtering of file path

I am opening this issue for reference in a future PR and to enable discussions around it.

For more flexibility, allowing developers to use templates in paths not relative to the class file, the plugin could allow filtering of the file path.

Not working with WordPress v4.7

I'm using this code in one of my plugins and works perfectly with the current version of WordPress.

Unfortunately it will no longer work with the upcomig v4.7 due to the changes they have made to accommodate post type templates.

I'm trying to figure it out but so far I'm just tearing my hair out!

Composer package created with additional features

Hey everybody,

I created new composer package from this class with some additional features:

  • you can now define your Templater (settings) and (templates) outside the class.
    • settings: plugin directory - plugin templates directory - plugin prefix
    • templates: your custom templates
  • support any post type custom template.
  • you can override final custom template file using filter outside the class.
  • handle some class methods and added new functionality.

How to use this new Templater

Github repo
Composer package

I hope this will be useful for somebody.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.