This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta content="text/html; charset=utf-8" http-equiv="Content-Type"> | |
<title>localhost</title> | |
</head> | |
<body> | |
<h1>It Works!</h1> | |
<ul> | |
<?php |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (isset($category)) { | |
$cat_name = $category->name; | |
$cat_alias = $category->alias; | |
$cat_description = $category->description; | |
$cat_alter_name = $category->params->get('content.category_title'); | |
$cat_subtitle = $category->params->get('content.category_subtitle'); | |
$cat_teasertext = $category->params->get('content.category_teaser_text'); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<modification> | |
<name>Featured module name replace</name> | |
<code>featuredmodulenamebyagatha65</code> | |
<version>1.0</version> | |
<author>agatha65.com</author> | |
<link>http://agatha65.com/services/opencart-extensions</link> | |
<file path="catalog/controller/extension/module/featured.php"> | |
<operation> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ----------------------------------------------------------------- | |
# .gitignore for WordPress @salcode | |
# ver 20160309 | |
# | |
# From the root of your project run | |
# curl -O https://gist.githubusercontent.com/salcode/b515f520d3f8207ecd04/raw/.gitignore | |
# to download this file | |
# | |
# By default all files are ignored. You'll need to whitelist | |
# any mu-plugins, plugins, or themes you want to include in the repo. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function remove_category_prefix_from_archive_title( $title ) { | |
if ( is_category() ) { | |
$title = single_cat_title( '', false ); | |
} elseif ( is_tag() ) { | |
$title = single_tag_title( '', false ); | |
} elseif ( is_author() ) { | |
$title = '<span class="vcard">' . get_the_author() . '</span>' ; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function themename_html_head_alter(&$head_elements) { | |
foreach ($head_elements as $key => $element) { | |
if (isset($element['#attributes']['rel']) && $element['#attributes']['rel'] == 'shortlink') { | |
unset($head_elements[$key]); | |
} | |
if (isset($element['#attributes']['rel']) && $element['#attributes']['rel'] == 'alternate') { | |
unset($head_elements[$key]); | |
} | |
} | |
unset($head_elements['system_meta_generator']); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MyController extends JController | |
{ | |
function someTask() | |
{ | |
// Get the application object. | |
$app = JFactory::getApplication(); | |
// Get the model. | |
$model = $this->getModel('MyModel'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// получаем URL параметры | |
// var allVars = $.getUrlVars(); | |
// получаем значение параметра по его имени | |
// var byName = $.getUrlVar('name'); | |
$.extend({ | |
getUrlVars: function(){ | |
var vars = [], hash; |