• Resolved danworld

    (@danworld)


    My php skill is still pretty basic. I may be missing something obvious.

    I’m trying to insert the statement but it isn’t working for me:
    if ( function_exists ( ‘echo_tptn_post_count’ ) ) echo_tptn_post_count();? ?

    I tested and function_exists() is true.

    But when I use the statement, nothing appears. If I try to use the statement with already working php in a hook, all the php in that hook is not displayed.

    This works in the hook:
    <?php
    the_category(‘ ‘);
    the_author_posts_link();
    the_tags( ‘Tags ‘, ‘ ‘, ” );
    ?>

    This doesn’t work, there is no output from any of the code in this hook:
    <?php
    the_category(‘ ‘);
    the_author_posts_link();
    the_tags( ‘Tags ‘, ‘ ‘, ” );
    if ( function_exists ( ‘echo_tptn_post_count’ ) ) echo_tptn_post_count();?
    ?>

    My php skill is still pretty basic. I may be missing something obvious.

    I’m using the Genesis framework. And Genesis Simple Hooks plugin.

    If I use the setting to just automatically add the counters to posts, the counter does show up that way.

    Thank you.

    https://www.ads-software.com/plugins/top-10/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author WebberZone

    (@webberzone)

    Can you tell me what happens if you toggle the option:
    “Always display latest post count”

    Thread Starter danworld

    (@danworld)

    Thanks for the quick reply.

    But playing with that option doesn’t seem to affect this problem.

    Plugin Author WebberZone

    (@webberzone)

    Can you please try this. It taps an internal function.

    <?php
    echo get_tptn_post_count( get_the_ID(), get_current_blog_id() );
    
    ?>
    Thread Starter danworld

    (@danworld)

    Ok, that worked! Much appreciated.

    And now, the original code also works. I wonder why?

    Which code should I use? Do I have to worry about something not working again in the future?

    Plugin Author WebberZone

    (@webberzone)

    You should continue using the “echo_tptn_post_count” code if that is working.

    It’s strange that it didn’t work once and is suddenly working. But, at least it works now ??

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘PHP Function manual insert not working? ?’ is closed to new replies.