[HACK] Wordpress functions in Bludit

Post Reply
User avatar
diego
Site Admin
Posts: 773
Joined: Sat May 16, 2015 2:53 pm
Been thanked: 1 time
Contact:

Function: has_tag()

Code: Select all

<?php

function has_tag($tag, $post) {
    $tagList = $post->tags(true);

    return in_array($tag, $tagList);
}

?>
Function: have_posts()

Code: Select all

<?php

function have_posts() {
    global $posts;

    return !empty($posts);
}

?>
Function: have_pages()

Code: Select all

<?php

function have_pages() {
    global $pages;

    return !empty($pages);
}

?>
User avatar
Edi
Site Admin
Posts: 3121
Joined: Sun Aug 09, 2015 5:01 pm
Location: Zurich
Has thanked: 54 times
Been thanked: 77 times
Contact:

Nice! :lol:
Clickwork - Websites mit Bludit | Planet Bludit - Tipps und Snippets
Post Reply