示例#1
0
def tag(slug, page=0):
    """List posts of a given tag"""
    pagination, posts = fromcache(
        "pag_posts_tag_%s_%s" % (slug, page)) or tocache(
            "pag_posts_tag_%s_%s" %
            (slug, page), wordpress.getPostsByTag(tag=slug, page=page))
    #Retorna a ultima foto inserida neste album.
    # picday = wordpress.wpgd.getLastFromGallery(conf.GALLERIA_FOTO_DO_DIA_ID)
    menus = fromcache('menuprincipal') or tocache(
        'menuprincipal',
        wordpress.exapi.getMenuItens(menu_slug='menu-principal'))

    psearch = _format_postsearch(posts)
    try:
        twitter_hash_cabecalho = twitts()
    except KeyError:
        twitter_hash_cabecalho = ""

    return render_template(
        'archive.html',
        sidebar=wordpress.getSidebar,
        twitter_hash_cabecalho=twitter_hash_cabecalho,
        # picday=picday,
        pagination=pagination,
        posts=psearch,
        menu=menus)
示例#2
0
def index():
    # First page data
    pagination, posts = wordpress.getPostsByTag(tag='governador-pergunta')
    images = gallery.search('GovernadorPergunta', limit=24)[::-1]
    videos = [wordpress.wpgd.getVideo(i) for i in (14, 16, 12)]
    return render_template(
        'balanco.html',
        posts=posts,
        images=images,
        videos=videos,
        pagename='govpergunta',
        menu=wordpress.exapi.getMenuItens(menu_slug='menu-principal'))
示例#3
0
def tag(slug, page=0):
    """List posts of a given tag"""
    pagination, posts = fromcache("pag_posts_tag_%s_%s" % (slug,page)) or tocache("pag_posts_tag_%s_%s" % (slug,page), wordpress.getPostsByTag(tag=slug, page=page) )
    #Retorna a ultima foto inserida neste album.
    # picday = wordpress.wpgd.getLastFromGallery(conf.GALLERIA_FOTO_DO_DIA_ID)
    menus = fromcache('menuprincipal') or tocache('menuprincipal', wordpress.exapi.getMenuItens(menu_slug='menu-principal') )

    psearch = _format_postsearch(posts)
    try:
        twitter_hash_cabecalho = twitts()
    except KeyError:
        twitter_hash_cabecalho = ""

    return render_template(
        'archive.html',
        sidebar=wordpress.getSidebar,
        twitter_hash_cabecalho=twitter_hash_cabecalho,
        # picday=picday,
        pagination=pagination,
        posts=psearch
        ,menu=menus)