WordPress.org

Ready to get started?Download WordPress

Forums

Plugins
Using colorbox in wordpress plugin (1 post)

  1. h_a86
    Member
    Posted 2 years ago #

    I have been using this code for writing a wordpress plugin. This plugin contains a colorbox. But this is not working. I can install plugin and can activate it successfully, but color box is not working. my code is

    <?php

    /*
    Plugin Name: abc
    Plugin URI: http://www.abc.com/
    Description: abc
    Author: abc
    Version: 1.0
    Author URI: http://www.abc.com
    */

    wp_enqueue_style('colorbox.css', '\wordpress\wp-content\plugins\calc_plugin\colorbox.css');

    wp_enqueue_script('jquery.js');
    wp_enqueue_script('colorbox.js', '\wordpress\wp-content\plugins\calc_plugin\colorbox.js', array('jquery'));

    function calc_form_markup() {
    $markup = <<<EOT

    <script>
    $(document).ready(function(){
    $(".inline").colorbox({inline:true, width:"600", height:"450"});
    });
    </script>

    <div style='display:none'>

    <div id='inline_content1' style='padding:10px; background:#fff;'>
    <p>This is inline content 1</p>
    <image src = "http://wallpaper.goodfon.com/image/240138-1360x768.jpg" width = "175" height = " 150">
    </div>

    </div>

    <p>Inline HTML</p>

    EOT;

    return $markup;

    }

    add_shortcode('calc_form', 'calc_form_markup');

    ?>

    http://wordpress.org/extend/plugins/plugins/

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags