Skip to content

Instantly share code, notes, and snippets.

@ABooooo
ABooooo / new_gist_file_0
Created August 19, 2014 07:50
Change CSS parameter
$( ".left li a i" ).css({ "padding-top" : "3px" });
@ABooooo
ABooooo / new_gist_file_0
Created August 19, 2014 20:01
Add dropdown with posts to contact form
wpcf7_add_shortcode('postdropdown', 'createbox', true);
function createbox(){
global $post;
$args = array('numberposts' => 0, 'category' => 5 );
$myposts = get_posts( $args );
$output = "<select name='cursus' id='cursus' onchange='document.getElementById(\"cursus\").value=this.value;'><option></option>";
foreach ( $myposts as $post ) : setup_postdata($post);
$title = get_the_title();
$output .= "<option value='$title'> $title </option>";
@ABooooo
ABooooo / new_gist_file_0
Created August 20, 2014 07:04
Include page
<?php
$include = get_pages('include=5');
$title = apply_filters('the_title',$include[0]->post_title);
echo $title;
$include = get_pages('include=5');
$content = apply_filters('the_content',$include[0]->post_content);
echo $content;
?>
@ABooooo
ABooooo / new_gist_file_0
Created August 21, 2014 07:33
Include shortcode
<?php echo do_shortcode('[contact-form-7 id="4" title="Kontaktni obrazec"]'); ?>
@ABooooo
ABooooo / new_gist_file_0
Created August 21, 2014 09:19
Add dropdown from post from two or more categories
wpcf7_add_shortcode('postdropdown', 'createbox', true);
function createbox(){
global $post;
$args1 = array('numberposts' => 0, 'category' => 14 );
$myposts1 = get_posts( $args1 );
$args2 = array('numberposts' => 0, 'category' => 19 );
$myposts2 = get_posts( $args2 );
$myposts = array_merge($myposts1, $myposts2);
@ABooooo
ABooooo / new_gist_file_0
Created October 2, 2014 09:42
Terminal install Typo3
Open the terminal
Move downloaded typo3_src-6.2.4.zip to host's root
mv ~/Downloads/typo3_src-6.2.4.zip /Application/MAMP/htdocs/typo3/
Go to destination folder:
cd /Application/MAMP/htdocs/typo3/
Still in this location unzip downloaded package (you can remove zip file after that)
@ABooooo
ABooooo / new_gist_file_0.php
Last active November 1, 2018 08:19
Absoluth server path with PHP
<?php
$path = getcwd();
echo "Your Absoluthe Path is: ";
echo $path;
?>
//for example for Joomla logs or tmp files
@ABooooo
ABooooo / new_gist_file_0
Created November 14, 2014 11:52
Get param from URL
$(document).ready(function(){
var urlParams;
(window.onpopstate = function () {
var match,
pl = /\+/g, // Regex for replacing addition symbol with a space
search = /([^&=]+)=?([^&]*)/g,
decode = function (s) { return decodeURIComponent(s.replace(pl, " ")); },
query = window.location.search.substring(1);
@ABooooo
ABooooo / new_gist_file_0
Created November 19, 2014 11:26
Add custom header typ
TS Config (root edit and code insert)
TCEFORM.tt_content.header_layout {
addItems {
10 = Gray Header
11 = Orange Header
12 = Red Header
}
}
@ABooooo
ABooooo / new_gist_file_0
Last active November 1, 2018 08:18
realUrl
.htaccess
RewriteEngine On
RewriteRule ^typo3$ - [L]
RewriteRule ^typo3/.*$ - [L]
RewriteRule ^uploads/.*$ - [L]
RewriteRule ^fileadmin/.*$ - [L]
RewriteRule ^typo3conf/.*$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l