• What I’m trying to do is hit “Press This” on any website and get the url to store into a new custom field. This custom field will serve as an external link to place anywhere in my theme.

    On the theme, (typically single.php)

    <?php
    $elink = get_post_meta($post->ID, 'elink', true);
    ?>
    <?php echo $elink ?>

    Now, if I were to use a normal Post editor, I would have to key in ‘elink’ in the Name field and the Url in the Value field.

    This works like charm. I’m able to see my link on the Single.php (theme)

    The bad news is, I still haven’t got it to play nicely with “Press This”

    What I did was

    1. Add the following line in wp-admin/press-this.php, line :559

    Link: <input name="elink" type="text"  id="elink" class="mceEditor" style="width:100%;" value="<?php echo $url; ?>"/>

    (this basically inserts URL into an input field.)

    2. Add this to press-this.php, line: 48

    $elink = $_REQUEST['elink'];

    (this is supposed to declare $elink as a varible)

    The problem I am having is, the URL is not sticking to the post. In other words, it’s not inserted into the database.

    I’m not a programmer, so please let me know where I screwed up. Thank you in advance.

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)

The topic ‘Press This – Adding Custom Field’ is closed to new replies.