Warning: count():










-2















Hey friends I am running my wordpress theme on localhost to make some changes. It shows following error without showing main navigation bar.



error:
Warning: count(): Parameter must be an array or an object that implements Countable in C:wamp64wwwfiverrwp-includespost-template.php on line 284 Call Stack #TimeMemoryFunctionLocation 10.0003404144main( )...index.php:0 20.0004404432require( 'C:wamp64wwwfiverrwp-blog-header.php' )...index.php:17 30.908112387632require_once( 'C:wamp64wwwfiverrwp-includestemplate-loader.php' )...wp-blog-header.php:19 40.925912455240include( 'C:wamp64wwwfiverrwp-contentthemesmarkutpage.php' )...template-loader.php:74 50.925912455240get_header( )...page.php:11 60.925912455616locate_template( )...general-template.php:41 70.926112455712load_template( )...template.php:647 80.926212456184require_once( 'C:wamp64wwwfiverrwp-contentthemesmarkutheader.php' )...template.php:688 90.927212470664wp_head( )...header.php:15 100.927212470664do_action( )...general-template.php:2614 110.927212471040WP_Hook->do_action( )...plugin.php:453 120.927212471040WP_Hook->apply_filters( )...class-wp-hook.php:310 131.027015883304markut_insert_fb_in_head( )...class-wp-hook.php:286 141.027015899816the_excerpt( )...index.php:158 151.027015899816get_the_excerpt( )...post-template.php:362 161.027115899816apply_filters( )...post-template.php:397 171.027115900216WP_Hook->apply_filters( )...plugin.php:203 181.027115901960wp_trim_excerpt( )...class-wp-hook.php:288 191.027115901960get_the_content( )...formatting.php:3308 About UsWe'r a dynamic teamLorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod"/>



the lines of post-template.php are:
if ( post_password_required( $post ) ) //281
return get_the_password_form( $post ); //282
if ( $page > count( $pages ) ) // if the requested page doesn't exist 284
$page = count( $pages ); // give them the highest numbered page that DOES exist 285










share|improve this question






















  • can you show us the code from post-template.php

    – Angel Deykov
    Nov 14 '18 at 7:01











  • Hey thanks for replying me... I could manage the error by editing the code. I wil provide the code to see someone.

    – Ayesha Fernando
    Nov 26 '18 at 8:29















-2















Hey friends I am running my wordpress theme on localhost to make some changes. It shows following error without showing main navigation bar.



error:
Warning: count(): Parameter must be an array or an object that implements Countable in C:wamp64wwwfiverrwp-includespost-template.php on line 284 Call Stack #TimeMemoryFunctionLocation 10.0003404144main( )...index.php:0 20.0004404432require( 'C:wamp64wwwfiverrwp-blog-header.php' )...index.php:17 30.908112387632require_once( 'C:wamp64wwwfiverrwp-includestemplate-loader.php' )...wp-blog-header.php:19 40.925912455240include( 'C:wamp64wwwfiverrwp-contentthemesmarkutpage.php' )...template-loader.php:74 50.925912455240get_header( )...page.php:11 60.925912455616locate_template( )...general-template.php:41 70.926112455712load_template( )...template.php:647 80.926212456184require_once( 'C:wamp64wwwfiverrwp-contentthemesmarkutheader.php' )...template.php:688 90.927212470664wp_head( )...header.php:15 100.927212470664do_action( )...general-template.php:2614 110.927212471040WP_Hook->do_action( )...plugin.php:453 120.927212471040WP_Hook->apply_filters( )...class-wp-hook.php:310 131.027015883304markut_insert_fb_in_head( )...class-wp-hook.php:286 141.027015899816the_excerpt( )...index.php:158 151.027015899816get_the_excerpt( )...post-template.php:362 161.027115899816apply_filters( )...post-template.php:397 171.027115900216WP_Hook->apply_filters( )...plugin.php:203 181.027115901960wp_trim_excerpt( )...class-wp-hook.php:288 191.027115901960get_the_content( )...formatting.php:3308 About UsWe'r a dynamic teamLorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod"/>



the lines of post-template.php are:
if ( post_password_required( $post ) ) //281
return get_the_password_form( $post ); //282
if ( $page > count( $pages ) ) // if the requested page doesn't exist 284
$page = count( $pages ); // give them the highest numbered page that DOES exist 285










share|improve this question






















  • can you show us the code from post-template.php

    – Angel Deykov
    Nov 14 '18 at 7:01











  • Hey thanks for replying me... I could manage the error by editing the code. I wil provide the code to see someone.

    – Ayesha Fernando
    Nov 26 '18 at 8:29













-2












-2








-2








Hey friends I am running my wordpress theme on localhost to make some changes. It shows following error without showing main navigation bar.



error:
Warning: count(): Parameter must be an array or an object that implements Countable in C:wamp64wwwfiverrwp-includespost-template.php on line 284 Call Stack #TimeMemoryFunctionLocation 10.0003404144main( )...index.php:0 20.0004404432require( 'C:wamp64wwwfiverrwp-blog-header.php' )...index.php:17 30.908112387632require_once( 'C:wamp64wwwfiverrwp-includestemplate-loader.php' )...wp-blog-header.php:19 40.925912455240include( 'C:wamp64wwwfiverrwp-contentthemesmarkutpage.php' )...template-loader.php:74 50.925912455240get_header( )...page.php:11 60.925912455616locate_template( )...general-template.php:41 70.926112455712load_template( )...template.php:647 80.926212456184require_once( 'C:wamp64wwwfiverrwp-contentthemesmarkutheader.php' )...template.php:688 90.927212470664wp_head( )...header.php:15 100.927212470664do_action( )...general-template.php:2614 110.927212471040WP_Hook->do_action( )...plugin.php:453 120.927212471040WP_Hook->apply_filters( )...class-wp-hook.php:310 131.027015883304markut_insert_fb_in_head( )...class-wp-hook.php:286 141.027015899816the_excerpt( )...index.php:158 151.027015899816get_the_excerpt( )...post-template.php:362 161.027115899816apply_filters( )...post-template.php:397 171.027115900216WP_Hook->apply_filters( )...plugin.php:203 181.027115901960wp_trim_excerpt( )...class-wp-hook.php:288 191.027115901960get_the_content( )...formatting.php:3308 About UsWe'r a dynamic teamLorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod"/>



the lines of post-template.php are:
if ( post_password_required( $post ) ) //281
return get_the_password_form( $post ); //282
if ( $page > count( $pages ) ) // if the requested page doesn't exist 284
$page = count( $pages ); // give them the highest numbered page that DOES exist 285










share|improve this question














Hey friends I am running my wordpress theme on localhost to make some changes. It shows following error without showing main navigation bar.



error:
Warning: count(): Parameter must be an array or an object that implements Countable in C:wamp64wwwfiverrwp-includespost-template.php on line 284 Call Stack #TimeMemoryFunctionLocation 10.0003404144main( )...index.php:0 20.0004404432require( 'C:wamp64wwwfiverrwp-blog-header.php' )...index.php:17 30.908112387632require_once( 'C:wamp64wwwfiverrwp-includestemplate-loader.php' )...wp-blog-header.php:19 40.925912455240include( 'C:wamp64wwwfiverrwp-contentthemesmarkutpage.php' )...template-loader.php:74 50.925912455240get_header( )...page.php:11 60.925912455616locate_template( )...general-template.php:41 70.926112455712load_template( )...template.php:647 80.926212456184require_once( 'C:wamp64wwwfiverrwp-contentthemesmarkutheader.php' )...template.php:688 90.927212470664wp_head( )...header.php:15 100.927212470664do_action( )...general-template.php:2614 110.927212471040WP_Hook->do_action( )...plugin.php:453 120.927212471040WP_Hook->apply_filters( )...class-wp-hook.php:310 131.027015883304markut_insert_fb_in_head( )...class-wp-hook.php:286 141.027015899816the_excerpt( )...index.php:158 151.027015899816get_the_excerpt( )...post-template.php:362 161.027115899816apply_filters( )...post-template.php:397 171.027115900216WP_Hook->apply_filters( )...plugin.php:203 181.027115901960wp_trim_excerpt( )...class-wp-hook.php:288 191.027115901960get_the_content( )...formatting.php:3308 About UsWe'r a dynamic teamLorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod"/>



the lines of post-template.php are:
if ( post_password_required( $post ) ) //281
return get_the_password_form( $post ); //282
if ( $page > count( $pages ) ) // if the requested page doesn't exist 284
$page = count( $pages ); // give them the highest numbered page that DOES exist 285







wordpress warnings






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 14 '18 at 0:18









Ayesha FernandoAyesha Fernando

55




55












  • can you show us the code from post-template.php

    – Angel Deykov
    Nov 14 '18 at 7:01











  • Hey thanks for replying me... I could manage the error by editing the code. I wil provide the code to see someone.

    – Ayesha Fernando
    Nov 26 '18 at 8:29

















  • can you show us the code from post-template.php

    – Angel Deykov
    Nov 14 '18 at 7:01











  • Hey thanks for replying me... I could manage the error by editing the code. I wil provide the code to see someone.

    – Ayesha Fernando
    Nov 26 '18 at 8:29
















can you show us the code from post-template.php

– Angel Deykov
Nov 14 '18 at 7:01





can you show us the code from post-template.php

– Angel Deykov
Nov 14 '18 at 7:01













Hey thanks for replying me... I could manage the error by editing the code. I wil provide the code to see someone.

– Ayesha Fernando
Nov 26 '18 at 8:29





Hey thanks for replying me... I could manage the error by editing the code. I wil provide the code to see someone.

– Ayesha Fernando
Nov 26 '18 at 8:29












1 Answer
1






active

oldest

votes


















0














This bug related to WordPress core bug
https://core.trac.wordpress.org/ticket/42814



Most often it occurs when you call the function get_the_excerpt or get_the_content outside the Loop provided that excerpt or content is empty.



So to fix it yourself you should find error place and check excerpt/content existing manually.



For example:



if(has_excerpt($post_id)) 
$meta = sprintf('<meta name="description" content="%s">',
get_the_excerpt($post_id)
);






share|improve this answer






















    Your Answer






    StackExchange.ifUsing("editor", function ()
    StackExchange.using("externalEditor", function ()
    StackExchange.using("snippets", function ()
    StackExchange.snippets.init();
    );
    );
    , "code-snippets");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "1"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53291374%2fwarning-count%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    This bug related to WordPress core bug
    https://core.trac.wordpress.org/ticket/42814



    Most often it occurs when you call the function get_the_excerpt or get_the_content outside the Loop provided that excerpt or content is empty.



    So to fix it yourself you should find error place and check excerpt/content existing manually.



    For example:



    if(has_excerpt($post_id)) 
    $meta = sprintf('<meta name="description" content="%s">',
    get_the_excerpt($post_id)
    );






    share|improve this answer



























      0














      This bug related to WordPress core bug
      https://core.trac.wordpress.org/ticket/42814



      Most often it occurs when you call the function get_the_excerpt or get_the_content outside the Loop provided that excerpt or content is empty.



      So to fix it yourself you should find error place and check excerpt/content existing manually.



      For example:



      if(has_excerpt($post_id)) 
      $meta = sprintf('<meta name="description" content="%s">',
      get_the_excerpt($post_id)
      );






      share|improve this answer

























        0












        0








        0







        This bug related to WordPress core bug
        https://core.trac.wordpress.org/ticket/42814



        Most often it occurs when you call the function get_the_excerpt or get_the_content outside the Loop provided that excerpt or content is empty.



        So to fix it yourself you should find error place and check excerpt/content existing manually.



        For example:



        if(has_excerpt($post_id)) 
        $meta = sprintf('<meta name="description" content="%s">',
        get_the_excerpt($post_id)
        );






        share|improve this answer













        This bug related to WordPress core bug
        https://core.trac.wordpress.org/ticket/42814



        Most often it occurs when you call the function get_the_excerpt or get_the_content outside the Loop provided that excerpt or content is empty.



        So to fix it yourself you should find error place and check excerpt/content existing manually.



        For example:



        if(has_excerpt($post_id)) 
        $meta = sprintf('<meta name="description" content="%s">',
        get_the_excerpt($post_id)
        );







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 30 '18 at 21:26









        Anton LukinAnton Lukin

        1735




        1735



























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53291374%2fwarning-count%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            這個網誌中的熱門文章

            How to read a connectionString WITH PROVIDER in .NET Core?

            In R, how to develop a multiplot heatmap.2 figure showing key labels successfully

            Museum of Modern and Contemporary Art of Trento and Rovereto