• brcrf

    (@brcrf)


    Hello everyone, I created an application on facebook and would like to integrate it to a post on my wordpress. This case, the Canvas Application URL facebook would be done in wordpress.
    So I made the call code from facebook in my single.php file
    adding code at the top of the file single.php
    <? php
    / ** Your unique ID from Facebook applications * /
    $ appid = ‘XXXXXX’;
    / ** Your Facebook applications secret * /
    $ appsecret = ‘XXXX’;?>

    My doubt is being the following:
    I want to call the appid and appsecret through a custom field, but I can not.
    I tried to add the code below into the field ‘XXX’ but to no avail
      <? php
    global $ wp_query;
    $ postid = $ wp_query-> post-> ID;
    echo get_post_meta ($ postid, ‘CUSTOM FIELD’, true);
    wp_reset_query ();
    ?>
    this code above is to run the custom field outside the loop, I added it in the field where I add the application number ($ appid), but not forward. The Custom field not just run inside the php code of facebook.

    Anyone know the correct way to call the number of the application through a custom field?

Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    You use echo to generate HTML on the user’s browser. To assign a value in PHP on your server you just use the assignment operator: =

    $appid = get_post_meta($postid, 'CUSTOM FIELD', true);

Viewing 1 replies (of 1 total)

The topic ‘appid custom field wordpress’ is closed to new replies.