Jump to content

URL dictates Name


krenzelman

Recommended Posts

Working in WordPress. I want to make it so that when a user puts a url into a field that it automatically links and displays the name of the page it is linking to not the url itself.  How would I go about making that work or is it even possible? 

 

Here's the code I'm working from..

 

 <?php if($item_website): ?>
                        <tr class="detail">
                            <td class="detail-label"><?php echo __('Website','company'); ?></td>
                            <td class="detail"><a href="<?php echo $item_website; ?>" class="text-green"><?php echo $item_website; ?></td>
                        </tr>
                        <?php endif; ?>
Link to comment
Share on other sites

how automatic? if you want it immediately after entering it into the box, it will require javascript and be much more complicated. if you want it after the submit button, then it just needs php and you can use php's curl function to accomplish what you want. the piece of code you show needs the info already, where is the address entered by a user, and where is the code that that form uses for an action?

Link to comment
Share on other sites

how automatic? if you want it immediately after entering it into the box, it will require javascript and be much more complicated. if you want it after the submit button, then it just needs php and you can use php's curl function to accomplish what you want. the piece of code you show needs the info already, where is the address entered by a user, and where is the code that that form uses for an action?

 

I just want it to appear after hitting the submit button. The address is entered in a form at the bottom of the Wordpress page editor, as seen below.. I didn't build the theme.. I'm just trying to customize it with very little knowledge, so I apologize if I sound like an idiot.  I think this is the code that it draws from: 

 

        array(
            'name' => __('Website', 'company'),
            'id' => $prefix . 'item_website',
            'type' => 'text',
            'desc' => __('', 'companyl')
        ),
 
Photo of WP Form
10988498565_95649d6ef5.jpg
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.