Skip to content

Instantly share code, notes, and snippets.

View proweb's full-sized avatar

Sergey Mochalov proweb

View GitHub Profile
@proweb
proweb / blank-template-snippets.txt
Created April 11, 2012 16:52 — forked from schmidt1024/template-snippets.txt
Blank Template Snippets for Joomla! 2.5
# index.php :: load the global joomla header
# between <head> and </head>
<jdoc:include type="head" />
# index.php :: output of the system messages
# between <body> and </body>
<jdoc:include type="message" />
# index.php :: article and component output
# between <body> and </body>
@proweb
proweb / default.vcl
Created November 4, 2015 15:40 — forked from fevangelou/default.vcl_PREFACE.md
The perfect Varnish configuration for Joomla (& other CMS based) websites
#################################################################################
### The perfect Varnish configuration for Joomla (& other CMS based) websites ###
#################################################################################
# USE: Place the contents of this configuration inside the main
# Varnish configuration file, located in: /etc/varnish/default.vcl (root server access required - obviously)
# IMPORTANT: The following setup assumes a 2 minute cache time. You can safely increase
# this to 5 mins for less busier sites or drop it to 1 min or even 30s for high traffic sites.
@proweb
proweb / gist:6c6100434e67aaa64ced
Created January 2, 2016 21:46 — forked from johnbillion/hierarchy.php
WordPress Template Hierarchy (as of WordPress 4.4)
<?php
/* WordPress Template Hierarchy as of WordPress 4.4
is_404() ---------------------------------------------------------------------------------------------------> 404.php
is_search() ------------------------------------------------------------------------------------------------> search.php
is_front_page() --------------------------------------------------------------------------------------------> front-page.php
is_home() --------------------------------------------------------------------------------------------------> home.php
@proweb
proweb / post_format_icon.php
Created February 15, 2017 11:20 — forked from smutek/post_format_icon.php
Function for Post Format icons
<?php
/**
* Output Post Format icons
*
* Outputs an icon for each post format. Set up to use Fontawesome,
* but can be used with anything, or you can just use CSS.
*
* @return string
*/
function post_format_icon() {
@proweb
proweb / gist:31f3c78ef08e4c86f1d10dbc6d352b21
Created May 19, 2017 14:13 — forked from dmitrymomot/gist:4654524
Получение в jquery get-параметра с url страницы
// получаем URL параметры
// var allVars = $.getUrlVars();
// получаем значение параметра по его имени
// var byName = $.getUrlVar('name');
$.extend({
getUrlVars: function(){
var vars = [], hash;
@proweb
proweb / params
Last active March 14, 2019 20:19 — forked from Vlasterx/Joomla fields
All field types for Joomla CMS
<fieldset name="ADMIN_TEST">
<field name="access" type="accesslevel" label="JFIELD_ACCESS_LABEL" description="JFIELD_ACCESS_DESC" class="span12 small" />
<field name="cache_handler" type="cachehandler" default="" label="Cache Handler Field type" description="COM_CONFIG_FIELD_CACHE_HANDLER_DESC" filter="word" />
<field name="mycalendar" type="calendar" default="5-10-2008" label="Select a date" description="" format="%d-%m-%Y" />
<field name="captcha" type="plugins" folder="captcha" label="Captcha Selection field" description="COM_CONTACT_FIELD_CAPTCHA_DESC" default="" filter="cmd">
<option value="">JOPTION_USE_DEFAULT</option>
<option value="0">JOPTION_DO_NOT_USE</option>
</field>
<field name="mycategory" type="category" extension="com_content" label="Select a category" description="" />
<field name="show_title" type="checkbox" label="Show title" description="Show the title of the item" value="1" />
@proweb
proweb / redirect-to-child.php
Created December 25, 2019 14:24 — forked from neverything/redirect-to-child.php
WordPress redirection page template to the first child page (menu_order) with WPML handling
<?php
/**
* Template Name: Redirect to child page
* Description: Redirects to the top child page
*
* @package PUT YOUR THEME NAME HERE :D
*/
global $post;
@proweb
proweb / pattern-query-grid-cover-stack.html
Created December 22, 2023 13:18 — forked from justintadlock/pattern-query-grid-cover-stack.html
Query Loop pattern with stretched Stack block nested in Cover
<!-- wp:query {"queryId":0,"query":{"perPage":"7","pages":0,"offset":0,"postType":"post","order":"desc","orderBy":"date","author":"","search":"","exclude":[],"sticky":"","inherit":false,"parents":[]},"align":"full","className":"pattern-post-grid-cover","layout":{"type":"constrained"}} -->
<div class="wp-block-query alignfull pattern-post-grid-cover"><!-- wp:group {"align":"full","style":{"spacing":{"padding":{"right":"var:preset|spacing|plus-3","left":"var:preset|spacing|plus-3","top":"var(\u002d\u002dtheme-spacing\u002d\u002dplus-3)","bottom":"var(\u002d\u002dtheme-spacing\u002d\u002dplus-3)"}}},"layout":{"type":"default"}} -->
<div class="wp-block-group alignfull" style="padding-top:var(--theme-spacing--plus-3);padding-right:var(--wp--preset--spacing--plus-3);padding-bottom:var(--theme-spacing--plus-3);padding-left:var(--wp--preset--spacing--plus-3)"><!-- wp:post-template {"align":"full","style":{"spacing":{"blockGap":"var:preset|spacing|minus-3"}},"className":"is-style-no-gap is-style-flex-grow is-style-fe