This file contains hidden or 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
<div class="widget"> | |
<h3>Kategori</h3> | |
<?php | |
$cats = explode("<br />",wp_list_categories('title_li=&echo=0&depth=1&show_count=1&style=none')); | |
$cat_n = count($cats) - 1; | |
for ($i=0;$i< $cat_n;$i++): | |
if ($i<$cat_n/2): | |
$cat_left = $cat_left.'<li>'.$cats[$i].''; | |
elseif ($i>=$cat_n/2): |
This file contains hidden or 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 mt_smart_excerpt(){ | |
$content = get_the_excerpt(''); | |
$dot = "."; | |
$position = stripos ($content, $dot); | |
if($position) { | |
$offset = $position + 1; | |
$position2 = stripos ($content, $dot, $offset); | |
$one_word = substr($content, 0, $position); | |
$two_words = substr($content, 0, $position2); | |
echo $two_words . '.'; |
This file contains hidden or 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 | |
$blogs = $wpdb->get_results( $wpdb->prepare("SELECT blog_id, domain, path FROM $wpdb->blogs WHERE site_id = %d AND public = '1' AND archived = '0' AND mature = '0' AND spam = '0' AND deleted = '0' ORDER BY domain ASC, path ASC", $wpdb->siteid), ARRAY_A ); | |
foreach ( (array) $blogs as $details ) {$blog_list[ $details['blog_id'] ] = $details;} | |
unset( $blogs ); | |
$blogs = $blog_list; | |
if (is_array( $blogs ) ){ | |
echo '<ul>'; | |
$array= array(); |
This file contains hidden or 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 projects_menu_entry($id, $title, $link_self) | |
{ | |
global $blog_id; | |
if ($id == $blog_id && !$link_self) | |
return; | |
echo '<li>'; |
This file contains hidden or 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 | |
global $switched; | |
switch_to_blog(7); | |
echo 'You switched from blog ' . $switched . ' to 7'; | |
restore_current_blog(); | |
echo 'You switched back.'; | |
?> |
This file contains hidden or 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 | |
$categories = wp_list_categories('title_li=&show_count=1&echo=0'); | |
$categories = preg_replace('/<\/a> \(([0-9]+)\)/', ' <span class="count">[\\1]</span></a>', $categories); | |
echo $categories; | |
?> |
This file contains hidden or 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
Windows Registry Editor Version 5.00 | |
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Folder\shell\Node] | |
@="Open Node here" | |
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Folder\shell\Node\command] | |
@="cmd.exe /s /k \"pushd \"%V\" & \"C:\\Program Files\\nodejs\\nodevars.bat\"\"" |
NewerOlder