intrebare wp


lp4ever1992


salut , vreau sa scot numele celui ce a publicat anumite articole

se poate face asa ceva ?
andyradutza
Din tema cred ca se face modificarea.
Daca de exemplu vrei sa scoti autorul de peste tot stergi asta din index.php sau single.php (depinde de tema):
CODSURSA
the_author()

Daca vrei sa scoti autorul din articolele scrise in anumite categorii poti face asta:
CODSURSA
// daca nu face parte din "categoria_ta" afiseaza numele autorului
if (!is_category('categoria_ta')) {
echo "Postat de ".the_author();
}

Sper ca-ti va fi de ajutor.

 
lp4ever1992
iti multumesc dar single si index nu contin acele coduri

single.php
CODSURSA
<?php

// This file is part of the Carrington Blog Theme for WordPress
// http://carringtontheme.com
//
// Copyright (c) 2008-2009 Crowd Favorite, Ltd. All rights reserved.
// http://crowdfavorite.com
//
// Released under the GPL license
// http://www.opensource.org/licenses/gpl-license.php
//
// **********************************************************************
// This program is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
// **********************************************************************

if (__FILE__ == $_SERVER['SCRIPT_FILENAME']) { die(); }

// NOTE: this file is here for compatibility reasons - active templates are in the single/ dir

cfct_single();

?>


si index.php

CODSURSA
<?php

// This file is part of the Carrington Blog Theme for WordPress
// http://carringtontheme.com
//
// Copyright (c) 2008-2009 Crowd Favorite, Ltd. All rights reserved.
// http://crowdfavorite.com
//
// Released under the GPL license
// http://www.opensource.org/licenses/gpl-license.php
//
// **********************************************************************
// This program is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
// **********************************************************************

if (__FILE__ == $_SERVER['SCRIPT_FILENAME']) { die(); }

// NOTE: this file is here for compatibility reasons - active templates are in the posts/ dir

cfct_posts();

?>
andyradutza
Da, asta nu este un template obisnuit, Carrington Blog Theme este un framework de creare teme pentru Wordpress din cate vad. O sa-l testez si-ti spun.
again
// NOTE: this file is here for compatibility reasons - active templates are in the posts/ dir
lp4ever1992
CITAT (again @ 5th July 2009, 15:43) *
// NOTE: this file is here for compatibility reasons - active templates are in the posts/ dir

am observat , le-am cautat si in acele foldere dar nu am gasit nimic in cod care sa se refere la autor
again
ce fisiere ai in folderul posts/ ?
 
lp4ever1992
am : tag , search , posts-default , home , category , si

author.php
CODSURSA
<?php

// This file is part of the Carrington Blog Theme for WordPress
// http://carringtontheme.com
//
// Copyright (c) 2008-2009 Crowd Favorite, Ltd. All rights reserved.
// http://crowdfavorite.com
//
// Released under the GPL license
// http://www.opensource.org/licenses/gpl-license.php
//
// **********************************************************************
// This program is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
// **********************************************************************

if (__FILE__ == $_SERVER['SCRIPT_FILENAME']) { die(); }
if (CFCT_DEBUG) { cfct_banner(__FILE__); }

global $authordata;

get_header();
?>
<div id="content">
<?php

if (have_posts()) {
    while (have_posts()) {
        the_post();
?>

    <h1 class="page-title"><?php printf(__('Posts by: <a href="%s">%s</a>', 'carrington-blog'), get_author_posts_url($authordata->ID), get_author_name($authordata->ID)); ?></h1>

<?php
        if (!empty($bio)) {
?>

    <div class="description author-bio">

        <h2><?php printf(__('About %s', 'carrington-blog'), get_author_name($authordata->ID)); ?></h2>
    
<?php
            echo cfct_basic_content_formatting(get_the_author_description());
?>
    
    </div>

<?php
        }
        break;
    }
}
rewind_posts();

cfct_loop();
cfct_misc('nav-posts');
?>

</div><!--#content-->
<?php

get_sidebar();

get_footer();

?>


si in mod surprinzator stergand tot ce se referea la autor pe site tot imi apare By user – ziua/luna/anul
andyradutza
Ca scoti "Posted by admin" cauti in directorul content fisierul numit content-default.php
Gasesti codul asta:
CODSURSA
<p class="by-line">
        <span class="author vcard full-author">
            <?php printf(__('<span class="by alt-font">By</span> %s', 'carrington-blog'), '<a class="url fn" href="'.get_author_link(false, get_the_author_ID(), $authordata->user_nicename).'" title="View all posts by ' . attribute_escape($authordata->display_name) . '">'.get_the_author().'</a>') ?>
        </span>
        <span class="date full-date"><span class="ndash alt-font">&ndash;</span> <abbr class="published" title="<?php the_time('Y-m-d\TH:i'); ?>"><?php the_date(); ?></abbr></span>
    </p><!--/by-line-->


Stergi si lasi doar atat:
CODSURSA
<p class="by-line">
        <span class="date full-date"><abbr class="published" title="<?php the_time('Y-m-d\TH:i'); ?>"><?php the_date(); ?></abbr></span>
    </p><!--/by-line-->

Astfel ramane doar data postarii. bafta!
lp4ever1992


am reusit , codul ce se referea la author era in /themes/carrington-blog/content/content-default.php

scuze cand m-am apucat de scris nu postase si andyradutza dar iti multumesc si tie mult ptr ajutor
Reclama
Am vazut aici ca au CASCO cu 5% mai ieftin. Pentru Renault e oferta in principal! Pare OK... uitati-va si voi!
Aceasta este o versiune simplificatã a paginii originale. Pentru a vizita versiunea originala click aici.