Beispiel #1
0
function search_display()
{
    global $smarty;
    theme_init($smarty);
    $smarty->display('default.tpl');
    unset($smarty);
    do_action('shutdown');
}
Beispiel #2
0
 function display()
 {
     $this->main();
     theme_init($this->smarty, $this);
     $this->smarty->display($this->tpl);
     unset($this->smarty);
     do_action('shutdown');
 }
Beispiel #3
0
function contact_display()
{
    global $smarty;
    contact_main();
    theme_init($smarty);
    $smarty->display('default.tpl');
    unset($smarty);
    do_action('shutdown');
}
Beispiel #4
0
function index_display()
{
    global $smarty;
    $module = index_main();
    theme_init($smarty);
    $smarty->display($module);
    unset($smarty);
    do_action('shutdown');
}
Beispiel #5
0
    global $lang;
    return $title = "{$title} {$sep} {$lang['admin']['head']}";
}
add_filter('wp_title', 'admin_title', 10, 2);
// setup admin_header
function admin_header_default_action()
{
    global $panel, $action;
    do_action("admin_{$panel}_{$action}_head");
}
add_filter('admin_head', 'admin_header_default_action');
$fp_config = config_load();
system_init();
main();
admin_panelstrings('admin.' . ADMIN_PANEL);
theme_init($smarty);
$smarty->register_function('controlpanel', 'showcontrolpanel');
$v = $lang['admin'][$panel][$action];
$smarty->assign_by_ref('panelstrings', $v);
$smarty->assign_by_ref('plang', $v);
if (isset($_GET['mod'])) {
    switch ($_GET['mod']) {
        case 'inline':
            $smarty->display(ABS_PATH . ADMIN_DIR . 'admin-inline.tpl');
            break;
        case 'ajax':
            echo $smarty->get_template_vars('success');
    }
} else {
    $smarty->display('admin.tpl');
}
// Register a custom menu named Main Menu
// http://codex.wordpress.org/Function_Reference/register_nav_menu
// register_nav_menu( $location, $description );
register_nav_menu("main-menu", "Main Menu");
register_nav_menu("sub-menu", "Sub Menu");
// Create a second menu (optional)
// Activate Post thumbnails
// http://codex.wordpress.org/Post_Thumbnails
add_theme_support("post-thumbnails");
// To set up images sizes for use with post-thumbnails use the Simple Images Sizes Plugin:
// http://wordpress.org/extend/plugins/simple-image-sizes/
// If your site plans to make use of JQuery you can have WP load JQuery with:
// Add JQuery to WP
function theme_init()
{
    if (!is_admin()) {
        wp_enqueue_script('jquery');
    }
}
theme_init();
function get_images_in_current_post($size = "thumbnail", $num = -1)
{
    global $post;
    $attachments = get_posts(array("numberposts" => $num, "post_type" => "attachment", "post_parent" => $post->ID, "orderby" => "name"));
    // Loop through array
    // [img, img, img ... ]
    foreach ($attachments as $attachment) {
        $img = wp_get_attachment_image($attachment->ID, $size);
        echo "<div class='post-img'>{$img}</div>";
    }
}