averin13

Как извлекать текст из записей или пустых страниц?

    35 сообщений в этой теме

    А называются они почему одинаково?

    Поделиться сообщением


    Ссылка на сообщение
    Поделиться на других сайтах

    А называются они почему одинаково?

    Нужно изменить названеи. Я изменил, но пока ничего не работает.

    Поделиться сообщением


    Ссылка на сообщение
    Поделиться на других сайтах
    Я изменил, но пока ничего не работает.

    Код шаблона приведите, в котором пытаесь значения вывести.

    Поделиться сообщением


    Ссылка на сообщение
    Поделиться на других сайтах
    Я изменил, но пока ничего не работает.

    Код шаблона приведите, в котором пытаесь значения вывести.

    Так вот это код, который у меня используют все страницы на Wordpress

    <?/*
    Template Name: Levgallery
    */?>
    <?php
    list($bfa_ata, $cols, $left_col, $left_col2, $right_col, $right_col2, $bfa_ata['h_blogtitle'], $bfa_ata['h_posttitle']) = bfa_get_options();
    get_header();
    extract($bfa_ata);
    ?>

    <?php /* If there are any posts: */
    if (have_posts()) : $bfa_ata['postcount'] = 0; /* Postcount needed for option "XX first posts full posts, rest excerpts" */ ?>

    <?php // Deactivated since 3.6.5
    # include 'bfa://content_above_loop';
    // Uses the following static code instead: ?>
    <?php bfa_next_previous_page_links('Top'); // For MULTI post pages if activated at ATO -> Next/Previous Navigation: ?>
    <?php if( is_category() AND function_exists('page2cat_output')) { page2cat_output($cat); } // For the plugin Page2Cat http://wordpress.org/extend/plugins/page2cat/ ?>

    <?php while (have_posts()) : the_post(); $bfa_ata['postcount']++; ?>

    <?php // Deactivated since 3.6.5
    #include 'bfa://content_inside_loop';
    // Uses the following static code instead: ?>
    <?php bfa_next_previous_post_links('Top'); // For SINGLE post pages if activated at ATO -> Next/Previous Navigation ?>
    <?php /* Post Container starts here */
    if ( function_exists('post_class') ) { ?>
    <div <?php if ( is_page() ) { post_class('post'); } else { post_class(); } ?> id="post-<?php the_ID(); ?>">
    <?php } else { ?>
    <div class="<?php echo ( is_page() ? 'page ' : '' ) . 'post" id="post-'; the_ID(); ?>">
    <?php } ?>
    <?php bfa_post_kicker('<div class="post-kicker">','</div>'); ?>
    <?php bfa_post_headline('<div class="post-headline">','</div>'); ?>
    <?php bfa_post_byline('<div class="post-byline">','</div>'); ?>
    <?php bfa_post_bodycopy('<div class="post-bodycopy clearfix">','</div>'); ?>
    <?php bfa_post_pagination('<p class="post-pagination"><strong>'.__('Pages:','atahualpa').'</strong>','</p>'); ?>
    <?php bfa_post_footer('<div class="post-footer">','</div>'); ?>
    </div><!-- / Post -->

    <?php endwhile; ?>

    <?php // Deactivated since 3.6.5
    # include 'bfa://content_below_loop';
    // Uses the following static code instead: ?>
    <?php bfa_next_previous_post_links('Middle'); // Displayed on SINGLE post pages if activated at ATO -> Next/Previous Navigation: ?>
    <?php bfa_get_comments(); // Load Comments template (on single post pages, and static pages, if set on options page): ?>
    <?php bfa_next_previous_post_links('Bottom'); // Displayed on SINGLE post pages if activated at ATO -> Next/Previous Navigation: ?>
    <?php bfa_archives_page('<div class="archives-page">','</div>'); // Archives Pages. Displayed on a specific static page, if configured at ATO -> Archives Pages: ?>
    <?php bfa_next_previous_page_links('Bottom'); // Displayed on MULTI post pages if activated at ATO -> Next/Previous Navigation: ?>

    <?php /* END of: If there are any posts */
    else : /* If there are no posts: */ ?>

    <?php // Deactivated since 3.6.5
    #include 'bfa://content_not_found';
    // Uses the following static code instead: ?>
    <h2><?php _e('Not Found','atahualpa'); ?></h2>
    <p><?php _e("Sorry, but you are looking for something that isn't here.","atahualpa"); ?></p>

    <?php endif; /* END of: If there are no posts */ ?>

    <?php get_footer(); ?>

    Поделиться сообщением


    Ссылка на сообщение
    Поделиться на других сайтах
    -_- А вывод произвольных полей-то где? Я угадать должен, где они выводятся у вас :D?

    Поделиться сообщением


    Ссылка на сообщение
    Поделиться на других сайтах

    Вывод полей прописан в footer php. Это же ведь нормально , так и должно быть.Ctrl+F

    <?= get_post_meta($post->ID, 'plan', true);


    <?php /* if index.php or another page template (copied from index.php) was not used */
    global $bfa_ata, $cols, $left_col, $left_col2, $right_col, $right_col2;
    if (!isset($bfa_ata))
    list($bfa_ata, $cols, $left_col, $left_col2, $right_col, $right_col2, $bfa_ata['h_blogtitle'], $bfa_ata['h_posttitle']) = bfa_get_options();
    ?>

    </td>

    <!-- / Main Column -->

    <!-- Right Inner Sidebar -->
    <?php if ( $right_col2 == "on" ) { ?>
    <td id="right-inner">


    </td>
    <?php } ?>

    <!-- Right Sidebar -->
    <?php if ( $right_col == "on" ) { ?>
    <div class="right-wrap">
    <script type="text/javascript">

    hs.graphicsDir = '<?php bloginfo('template_url'); ?>/highslide/graphics/';

    hs.align = 'center';

    hs.transitions = ['expand', 'crossfade'];

    hs.outlineType = 'rounded-white';

    hs.fadeInOut = true;

    hs.numberPosition = '';

    hs.dimmingOpacity = 0.75;



    // Add the controlbar

    if (hs.addSlideshow) hs.addSlideshow({

    //slideshowGroup: 'group1',

    interval: 5000,

    repeat: false,

    useControls: true,

    fixedControls: 'fit',

    overlayOptions: {

    opacity: .75,

    position: 'bottom center',

    hideOnMouseOut: true

    }

    });

    </script>



    <script language="javascript" type="text/javascript">



    function placeXhib () {

    if ( $.browser.msie ) {

    $("#right-links").animate({width:''+160+'px', height:''+250+'px', opacity:'0.6', left:'0px', top:'2.3em'}, 2000);

    } else {

    $("#right-links").animate({width:''+150+'px', height:''+236+'px', opacity:'0.6', left:'0px', top:'2.3em'}, 2000);

    }

    $("#right-links").removeClass("xPanded");



    }

    function xpandXhib () {

    if ( $.browser.msie ) {

    $("#right-links").animate({width:''+($(".left-wrap").width()+190)+'px', minHeight:'500px', opacity:'0.9', left:'-'+ ($(".left-wrap").width()+30)+'px', top:'-2.8em'}, 2000);

    } else {

    $("#right-links").animate({width:''+($(".left-wrap").width()+180)+'px', height:'auto', opacity:'0.9', left:'-'+ ($(".left-wrap").width()+30)+'px', top:'-2.8em'}, 2000);

    }

    $("#right-links").addClass("xPanded");



    }

    function lt_correct_width()

    {



    $("#makeMeScrollable").css("width", "100%");

    $("#makeMeScrollable").css("width", $("#makeMeScrollable").width() + " px");

    $("#brc").css("width",$("#main-wrap").width()+"px");

    $("#br").css("height", $("#brc img").height());



    }

    function getClientHeight()

    {

    return document.compatMode=='CSS1Compat' && !window.opera?document.documentElement.clientHeight:document.body.clientHeight;

    }



    function lt_redline () {

    var main = $("#main-wrap").offset();

    var top = getClientHeight() - ($("#main-wrap").height()+main.top);

    if (top < 72) top = 20; else top = top - 20;

    top = ($("#main-wrap").height()+main.top) + top;

    $("#redbottom").css("top", top);

    // $("#copyright").css("top", top+40);

    }



    $(document).ready(function() {



    /*$("a#rli_open").colorbox({width:"70%", inline:true, href:"#rli_container"});*/





    $('#right-links a').click( function() {

    //alert(this.attr("href"));

    window.location.href($(this).attr("href"));

    });



    var ropen = 0;

    $('div[id!="right-links" ] ' && 'div[id!="#right-links div" ] ' && 'div[!="#right-links div а" ] ' ).click( function() {

    if (ropen != 0) {

    ropen = 0;

    placeXhib ();

    }

    });



    $("#rli_open, #right-links div").click(function() {

    xpandXhib();

    ropen = 1;

    return false;

    });



    $("#rli_open, #bottombigimg div").click(function() {

    xpandXhib();

    ropen = 1;

    return false;

    });

    });

    $(window).load(function () {

    lt_correct_width();

    $("div#makeMeScrollable").smoothDivScroll({ autoScroll: "onstart", autoScrollDirection: "backandforth", autoScrollStep: 2, autoScrollInterval: 25});

    lt_redline ();







    $("#br").css("right", "-"+$("#brc").width()+"px");



    $("#brb").click( function () {

    if ($("#br").css('right') == '30px') {

    $("#br").animate({right:'-'+$("#brc").width()+'px'}, 2000);

    $("#brb").css("background-image", "url('/images/arrow_button_left.png')");

    } else {

    $("#br").animate({right:'30px'}, 2000);

    $("#brb").css("background-image", "url('/images/arrow_button_right.png')");

    }

    return false;

    });



    $("div#scrollableArea").width($("div#scrollableArea").width() + 10);

    });

    $(window).resize(function() {

    lt_correct_width();

    lt_redline ();

    });



    </script>



    <div id="right-links" class="backing1 o70">

    <div style="cursor: pointer; text-align: center; font-size: 29px; padding: 0.1em 0; border-bottom: 1px solid #b3b2b2;font-weight:normal;">
    Exhibitions
    </div>

    <div style="font-size:12px;">

    <a href="/levgallery/?page_id=172" >Bank saint-petersburg</a>

    <a href="/levgallery/?page_id=164" >Konstantin Palace. Management<br/> Administration of the President of the RF. The National Congress Palace</a>

    <a href="/levgallery/?page_id=177" >Northern Capital House #1</a>

    <a href="/levgallery/?page_id=178" >Northern Capital House #2</a>

    <a href="/levgallery/?page_id=179" >Northern Capital House #3</a>
    </div>


    <div id="rli_open" class="o70">...</div>



    </div>



    </div>




    <?php } ?>
    <!-- / Right Sidebar -->

    </tr>
    <!-- / Main Body -->

    <tr>
    <div class="clear"></div>

    <div class="h30"></div>
    <div align="right" style="width:100%"><table cellpadding="0" cellspacing="0">
    <tr>
    <td><div class="bottombigimg" id="bottombigimg" style="margin-right:30px; margin-top:-30px;">
    <?= get_post_meta($post->ID, 'plan', true); ?></div></td>

    <td><div class="bottombigimg" style="margin-right:30px;margin-top:-30px;"></div></td>
    </tr></table>


    </div>


    <!-- Footer -->




    </tr>
    </table><!-- / layout -->
    </div><!-- / container -->

    </div><!-- / wrapper -->


    <div id="redbottom" style="width:100% ;height:15px; bottom: 0;position: absolute ">+7 921 3795205 ©levgallery 2003 - 2011</div>

    <div id="copyright"></div>
    </body>
    </html>

    Изменено пользователем averin13

    Поделиться сообщением


    Ссылка на сообщение
    Поделиться на других сайтах

    <?= get_post_meta($post->ID, 'plan', true); ?></div></td>

    Так вы, может, сначала создадите поле с названием 'plan', прежде чем его использовать?

    Поделиться сообщением


    Ссылка на сообщение
    Поделиться на других сайтах

    <?= get_post_meta($post->ID, 'plan', true); ?></div></td>

    Так вы, может, сначала создадите поле с названием 'plan', прежде чем его использовать?

    Так поле создал, а в значении прописываю текст или что?Но я именно создал поле в блоке Произвольные поля, а не в более верхнем блоке custom field template.

    Изменено пользователем averin13

    Поделиться сообщением


    Ссылка на сообщение
    Поделиться на других сайтах

    Ну приехали. Вы на Паскале что ли до этого писали? 'Plan' и 'plan' - таки разные строки, не находите?

    Поделиться сообщением


    Ссылка на сообщение
    Поделиться на других сайтах

    Ну приехали. Вы на Паскале что ли до этого писали? 'Plan' и 'plan' - таки разные строки, не находите?

    Да всё курто, всё работает :yahoo: . Спасибо, что помогли мне, простите меня за расспросы, но мне всего 13 лет. А про Паскаль, я программировал на нём долго, но здесь просто ошибся.

    Поделиться сообщением


    Ссылка на сообщение
    Поделиться на других сайтах

    Создайте аккаунт или войдите в него для комментирования

    Вы должны быть пользователем, чтобы оставить комментарий

    Создать аккаунт

    Зарегистрируйтесь для получения аккаунта. Это просто!


    Зарегистрировать аккаунт

    Войти

    Уже зарегистрированы? Войдите здесь.


    Войти сейчас