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 | |
add_filter('widget_text', 'php_text', 99); | |
function php_text($text) { | |
if (strpos($text, '<' . '?') !== false) { | |
ob_start(); | |
eval('?' . '>' . $text); | |
$text = ob_get_contents(); | |
ob_end_clean(); |
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 | |
function my_widgets_init() { | |
//Registering Prymar Widget Area | |
register_sidebar( array( | |
// The name of the sidebar | |
'name' => __( 'Primary Sidebar' ), | |
// The ID of the sidebar ( used to display it ) | |
'id' => 'primary_header', | |
// A short description of the sidebar ( visibile only in the admin panel ) | |
'description' => __( 'This is the Primary Sidebar', 'acer' ), |
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 | |
function is_sidebar_active($index) { | |
global $wp_registered_sidebars; | |
$widgetcolums = wp_get_sidebars_widgets(); | |
if ($widgetcolums[$index]) | |
return true; | |
return false; | |
} |
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
li > a:after { content: ' »'; } /* Change this in order to change the Dropdown symbol */ | |
li > a:only-child:after { content: ''; } |
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
# Redirect www urls to non-www | |
RewriteEngine on | |
RewriteCond %{HTTP_HOST} !^example\.com | |
RewriteRule (.*) http://example.com/$1 [R=301,L] |
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
Options +FollowSymlinks -MultiViews | |
RewriteEngine On | |
RewriteRule ^([a-zA-Z0-9_-]+)$ index.php?url=$1 | |
RewriteRule ^([a-zA-Z0-9_-]+)/$ index.php?url=$1 | |
RewriteRule ^(.+)(\s|%20)(.+)$ /$1-$3 [R=301,QSA,L,NE] |
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 get_category_by_slug( $slug ) ?> |
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
<? | |
$q = new query(); | |
if ( $result = $q->query( $q->the_query() ) ) { | |
while ( $row = $q->the_post( $result ) ) { ?> | |
<h2><?php echo $q->the_title($row) ?></h2> | |
<?php echo $q->the_content($row) ?> |
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 | |
$rank = 2; // Admin | |
?> | |
<select class="select" name="rank"> | |
<option<?php if ($rank == '1' ) { ?> selected="selected" <?php } ?> value="1">User</option> | |
<option<?php if ($rank == '2' ) { ?> selected="selected" <?php } ?> value="2">Admin</option> | |
</select> |
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
#pop { | |
z-index:999999; | |
position:fixed relative; | |
margin:20% auto; | |
display:none; | |
width:200px; | |
height:200px; | |
border: 1px solid #000; | |
} |