Support

Account

Home Forums General Issues get_field not working after moving server?

Solved

get_field not working after moving server?

  • Hi there.

    I have the weirdest problem, and I’ve searched and searched without luck.

    I have developed a site on MAMP PRO on my mac, and everything works perfectly, and now when ready to deploy the site I experience that some functions doesn’t work on the “Live site”.

    I have a child theme with a functions.php, and one of the functions make a lookup about author name, since I’ve imported som authors from the old system.

    In the original theme file it got the authorname by calling “the_author_posts_link();” (This doesnt work now either), but since I have saved all the imported authors with a custom field, I call “get_field( ‘source’);” to get the authorname, if the WordPress author field is import.user.

    But everything has stopped working, but many of my other stuff works perfectly.

    Can anyone point me in the right direction? I have 755 on permissions, but for me it seems like another problem, but I’m all out of ideas.

    I tried to move the function from functions.php to single.php, but still no luck. It could be a server issue, but don’t know where to look.

    Attached is my function

    function rec_author_info()
    {
        if ( !empty( $deprecated ) )
            _deprecated_argument( __FUNCTION__, '2.1' );
    
        global $authordata;
        if ( !is_object( $authordata ) )
            return false;
    
        if ($authordata->ID == 8)
        {
            echo get_field( 'source');
    
        }
        else
            the_author_posts_link();
    }

    EDIT: Solved it myself. Damn it, had <? on one server and needed <?php.

Viewing 1 post (of 1 total)

The topic ‘get_field not working after moving server?’ is closed to new replies.