Skip to content

Instantly share code, notes, and snippets.

<?php
//====================================================================================================+
// File name : berliCRM_webserviceexamples.php
// Begin : 2014-01-02
// Last Update : 2018-02-26
// Author : Alexander Krawczyk - info@crm-now.de - http://www.crm-now.de
// Version : 2.0.0
// License : GNU LGPL (http://www.gnu.org/copyleft/lesser.html)
//-----------------------------------------------------------------------------------------------------
// Copyright (C) 2004-2018 crm-now GmbH
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Lottie Player Example</title>
<script src="https://unpkg.com/@dotlottie/player-component@1.0.0/dist/dotlottie-player.js"></script>
</head>
<?php
$_GET['page_id']=2464;
// Replace the page id with actual id of page.
define('WP_USE_THEMES', true);
/** Load the WordPress Template */
require('../wp-blog-header.php');
<?php
class recent_posts_widget extends WP_Widget {
//widget constructor function
function __construct() {
$widget_options = array (
'classname' => 'class recent_posts_widget',
'description' => 'Widget to display latest posts.'
<?php
// function to Register a Widget Area (Sidebar)
add_action( 'widgets_init', 'my_custom_sidebar' );
function my_custom_sidebar() {
$args = array(
'name' => 'sidebar-1',
'id' => 'sidebar-1',
'description' => 'My Custom Sidebar',
'class' => '',
'before_widget' => '<div id="%1$s" class="widget %2$s">',
<?php
/*
Template Name: Ajax Filters
*/
get_header();
?>
<section style="padding-top:200px;">
<div class="container">
<div class="row">
<div class="col-md-3">
<?php
/* Ajax Filters Function */
add_action("wp_ajax_ajax_filters", "ajax_filters_handler");
add_action("wp_ajax_nopriv_ajax_filters", "ajax_filters_handler");
function ajax_filters_handler() {
$cat_ids = $_REQUEST['category'];
$csv_cats = implode(", ", $cat_ids);
echo "Showing Results for (Term ID):".$csv_cats;
Options -Indexes
# BEGIN WordPress
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
#force https:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^example\.com [NC]
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.example.com/$1 [R=301,L]
#Force http:
RewriteEngine On
RewriteCond %{HTTPS} on
RewriteRule ^ http://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]