Giter VIP home page Giter VIP logo

kohana-for-wordpress's Introduction

=== Kohana for Wordpress ===
Contributors: kerkness
Donate link: http://kerkness.ca/kohana-for-wordpress
Tags: kohana, developer, extend, plugin
Requires at least: 2.8
Tested up to: 2.8
Stable tag: 2.0.0

Plugin for running the Kohana 3.0 framework inside of Wordpress

== Description ==

Kohana for WordPress is a wordpress plugin that allows you to integrate 
PHP applications that use the Kohana 3.0 architecture with a wordpress site. 

**What is Kohana?**

Kohana is a PHP 5 framework that aims to be secure, lightweight, and easy to use.

**Requirements**

Kohana for Wordpress has been built and tested using Wordpress 2.8 and Kohana 3.0

If you don't have Kohana 3.0 installed you can get it at the following link.
http://dev.kohanaphp.com/projects/kohana3/files

**Support**

Get plugin support at http://forum.kohanaphp.com

== Installation ==

* Download and install Kohana 3.0 from here http://dev.kohanaphp.com/projects/kohana3/files
* Download and install the plugin into your *wp-content/plugins* folder
* activate plugin
* adjust settings for the plugin and set correct path to kohana system folders

== Optional ==

* Download the Wordpress for Kohana module.

== Kohana Links and Resources ==

* [Kohana 3.0 Beta Source](http://github.com/shadowhand/kohana/)
* [Kohana Forums](http://forum.kohanaphp.com)

kohana-for-wordpress's People

Contributors

kerkness avatar mclin 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

Watchers

 avatar  avatar

kohana-for-wordpress's Issues

kohana-for-wordpress's the_content filter replaces exceprts and other non-main content

I added some recent posts excerpts in a side bar to my kohana pages, and they end of having their content replaced by kohana_the_content_filter. I wouldn't have thought that a the_content filter would be called on an excerpt but it is.

My solution was to change kohana_the_content_filter into a custom kohana_content action and then trigger in in my template ala
http://www.raymondselda.com/understanding-action-hooks-in-wordpress/

This isn't ideal though. The advantage of the the_content filter is that you don't have to edit the template files to use kohana, which is good for people not familiar with hacking wordpress. On the other hand the action makes things more explicit.

Idea: Allow user to specify WP template for use with all Kohana requests

I found it difficult to get Wordpress to render Kohana requests with the right template. I added a filter so that, for Kohana requests, it always uses the same page template.

add_filter('page_template', kohana_page_template_filter);

function is_kohana_request()
{
    global $wp;
    return ($wp->kohana->request != null) ? true : false;
}

function kohana_page_template_filter($template) {
    if (is_kohana_request()) {
        return locate_template(array('kohana.php'));
    }
    return $template;
}

For this code, you have to have a kohana.php template in your theme. Mine's pretty basic, but it would depend on your theme. It might be useful to be able to select a kohana page template from the WP admin.

<?php
/*
Template Name: Kohana   
*/
?>
<?php get_header(); ?>
<div id="content" class="with-sidebar">
    <div id="main-content" class="single-post">
        <div id="main-content-inner">
            <?php echo apply_filters('the_content', $post->post_content); ?>
        </div>
    </div>
</div> <!-- end main-content -->
<?php get_footer(); ?>

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.