Converting HTML code to doc

Introduction

This is not a common problem, but still important. If you want to export data from a web app to Microsoft Word or Open/Libre Office, you will mostlikely use PHPWord.

PHPWord is a great choice for this, because you can define templates, that means, that you can write a Word document, and include tags to replace in it.

However, PHPWord does not allow the conversion of HTML marked-up text to OpenXML, the markup of Microsoft Office documents. Continue reading “Converting HTML code to doc”

PHP Everywhere

PHP Everywhere allows the usage of PHP in Widgets, Posts and Pages.
PHP Everywhere allows the usage of PHP in Widgets, Posts and Pages.

I created this plugin because I have not found a WordPress PHP plugin which is simple to use and provides a good user experience while being able to use PHP or HTML in Posts, Pages or Widgets. It is able to use multiple PHP instances and has built in role management.

Download

Download it here.

Features

Use PHP and HTML in

  • Widgets
  • Pages
  • Posts

Changelog

1.0:

  • initial release

1.1:

  • added multiple PHP instances

1.1.2:

  • fixed some bugs

1.2:

  • added a german translation

Translation

Usage

Widgets

Simply activate the

PHP + HTML

Widget. in your sidebar and paste your PHP code including the PHP Tags like this:

<?php  echo("Hello, World!"); ?>

You code may contain HTML Elements or have multiple lines.

Posts & Pages

Edit or create a new post or page and simply put your PHP Code including the PHP Tags into the side options_box, which is labeled “PHP Everywhere”. Then put the

[php_everywhere]

shortcode where you want the code to appear. Your code may contain multiple lines or HTML Tags.

Multiple PHP instances

If you want to use multiple PHP instances use the shortcode with the instance parameter like this:

[php_everywhere instance="1"]

Your PHP snippet should look like this:

<?php
if($instance=="1")
{
echo("Number one!");
}
if($instance=="2")
{
echo("Number two!");
}
?>