• úvod
  • témata
  • události
  • tržiště
  • diskuze
  • nástěnka
  • přihlásit
    registrace
    ztracené heslo?
    QUITEwordpress
    TRZNICE
    TRZNICE --- ---
    ja uy sem to nasel... civoe picovina jak slak - - -

    aby to fungovalo i ve footer.php u me tak musim dat jeste pred to tohle:
    <?php wp_reset_query(); ?>

    CRS1138
    CRS1138 --- ---
    Pripadne se podivej do wp-includes/query.php.
    CRS1138
    CRS1138 --- ---
    TRZNICE: co tohle?


    393 /**
    394 * Is the query for the front page of the site?
    395 *
    396 * This is for what is displayed at your site's main URL.
    397 *
    398 * Depends on the site's "Front page displays" Reading Settings 'show_on_front' and 'page_on_front'.
    399 *
    400 * If you set a static page for the front page of your site, this function will return
    401 * true when viewing that page.
    402 *
    403 * Otherwise the same as @see is_home()
    404 *
    405 * @see WP_Query::is_front_page()
    406 * @since 2.5.0
    407 * @uses is_home()
    408 * @uses get_option()
    409 *
    410 * @return bool True, if front of site.
    411 */
    412 function is_front_page() {
    413 global $wp_query;
    414
    415 if ( ! isset( $wp_query ) ) {
    416 _doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1' );
    417 return false;
    418 }
    419
    420 return $wp_query->is_front_page();
    421 }



    http://core.trac.wordpress.org/browser/tags/3.5/wp-includes/query.php#L0
    TRZNICE
    TRZNICE --- ---
    CRS1138: ja vubec nechapu pro by tak jednoduchej zapis mel bejt s necim v konfliktu... nemam se ceho chytit
    CRS1138
    CRS1138 --- ---
    TRZNICE: "…a co rikala Vilma dal?"
    "Hledej, smudlo, hledej!"
    TRZNICE
    TRZNICE --- ---
    ono to funguje totiz jenom na zacatku zdrojaku, kdyz je to tesne pod body... jinde uz to nedela nic... takze tam bude naky zlo : )
    TRZNICE
    TRZNICE --- ---
    to mi fakt hlava nebere, co se mu deje
    TRZNICE
    TRZNICE --- ---
    tak zatim to zabralo akorat na is_single, to vraci true, false jak ma... cipico...
    TRZNICE
    TRZNICE --- ---
    furt to vraci false at sem kde sem, ten druhej pripad
    CRS1138
    CRS1138 --- ---
    Divny to kazdopadne je, spis bych hledal chybu nekde v tvem kodu, i kdyz ten uryvek co jsi postnul je ok
    CITRONAK
    CITRONAK --- ---
    TRZNICE: to kazdopadne ano
    TRZNICE
    TRZNICE --- ---
    CITRONAK: me je spis divny ze jeden pripad funguje, ten druhej v blede modrym ne... neni to divny?
    CITRONAK
    CITRONAK --- ---
    TRZNICE: v tom by problem byt nemel. Me to vzdy take fungovalo tak, jak je dane v http://codex.wordpress.org/Function_Reference/ .

    Zkus to obejit tak, ze si v headeru to checkni a vytvorit konstantu, kterou pak pouzivej vsude jinde.
    TRZNICE
    TRZNICE --- ---
    CRS1138: tj to sem cetl, spis nechapu proc jeden pripad funguje, druhej ne... neni problem v tom ze jeden mam v header.php, ten fungujici a ten druhej ve footer.php? podle myho by to nemelo mit vliv, oba delaj to samy prakticky v principu
    CRS1138
    CRS1138 --- ---
    TRZNICE: nevim, me to vzdy fungovalo jak je to popsany v definici
    TRZNICE
    TRZNICE --- ---
    mam a je zajmavy ze jide to funguje, respektive v jiny casti zdrojaku... tohle maka normalne

    <?php
    if( is_front_page() ) {
    echo "";
    } else {
    include "login/buttons.php";
    }
    ?>
    CRS1138
    CRS1138 --- ---
    CRS1138: This Conditional Tag checks if the main page is a posts or a Page. This is a boolean function, meaning it returns either TRUE or FALSE. It returns TRUE when the main blog page is being displayed and the Settings->Reading->Front page displays is set to "Your latest posts", or when is set to "A static page" and the "Front Page" value is the current Page being displayed.
    TRZNICE
    TRZNICE --- ---
    s is_home to porad dela to samy...
    CRS1138
    CRS1138 --- ---
    No a mas front page nastavenou v settings?
    TRZNICE
    TRZNICE --- ---
    delam neco spatne? ze mam furt na vsech strankach xxx

    <?php
    if( is_front_page() ) {
    echo "x";
    } else {
    echo "xxx";
    }
    ?>
    Kliknutím sem můžete změnit nastavení reklam