Questions tagged [links]

Apart from the obvious meaning, `link` in the WP context also stands for a special post format. Please use the `permalink` tag for questions about the url structure of a site.

15
votes
2answers
3k views

Add custom options to the wplink dialog

I managed to add a custom option-select for images with function attachment_field_credit( $form_fields, $post ) { $field_value = get_post_meta( $post->ID, 'first_image', true ); $...
15
votes
4answers
191 views

How do I check if I linked to a post before I delete it?

If I want to "safely" delete a post. I want to make sure that no link exists (within my blog) to "to-be-deleted" post. How do I do that?
12
votes
1answer
2k views

How to use “Add link” pop up for a WordPress widget

In the WYSIWYG editor of WordPress you get pop up if you want to add a link for a text. Is there a possibility to access this functionality? Because I want to use this pop up for a WordPress widget ...
11
votes
1answer
2k views

How to use wpLink without editor?

I would like to create theme option to add a link. Loading these scripts and triggering the dialog works fine if wp editor is present. wp_enqueue_script('wplink'); wp_enqueue_script('wpdialogs'); ...
11
votes
2answers
27k views

Why is there a link tag with rel “profile” pointing to gmpg.org?

I found this <link rel="profile" href="http://gmpg.org/xfn/11"> in header.php file of WordPress theme. What will happen if I don't use this? What will happen if I use this ?
10
votes
2answers
4k views

On the WordPress Admin section how do I link to submenu pages created for a plugin?

So i'm trying to create a WordPress plugin and I've created some menu pages using this provided function: add_submenu_page('my_plugin_menu', 'Edit record page', 'Edit record page', 'manage_options', '...
9
votes
2answers
2k views

How can I use the built in Wordpress “browse link” functionality?

I'm coding a widget and I'd like the user to be able to pick a link like you can when editing a regular posts or page (when you click on the little link icon and you get the AJAX search functionality ...
8
votes
1answer
21k views

Get parent page url to show up when it is in child pages

I would like to ask that, how to get the link back to parent page when i'm in the child pages? I would rather to use a proper link instead of <a href="javascript:history.back()">Go Back</a>...
8
votes
1answer
25k views

Add custom menu item using wp_nav_menu_items filter

I have added a snippet to add a "Profile" link to my website navigation menu. My code: add_filter( 'wp_nav_menu_items', 'my_nav_menu_profile_link'); function my_nav_menu_profile_link($menu) { ...
8
votes
1answer
10k views

remove links from images using functions.php

I am looking for a way to remove the attachment link from images in the post content. I would like to add this to the functions.php in my theme. I know you can disable this in the post on a per ...
7
votes
2answers
21k views

Add CSS Class to Link in TinyMCE editor

In searching for a solution, I've come across the plugin to enable a dropdown of CSS styles already present within a stylesheet. What I want is to allow the editor to add CSS Classes from a textbox. ...
7
votes
6answers
60k views

Redirecting to old domain after migration

I have moved one of my website to a new domain, below is what i did. Backed up database Uploaded all the files to the new server. Imported sql into new server via phpmyadmin Now i have used this ...
7
votes
3answers
519 views

The Essential WordPress Websites / Weblogs? [closed]

I am looking for the essential weblogs / references / sites to place in my bookmark collection / sidebar. Is it possible that add a) either a link to existing bookmark collections b) additional sites ...
6
votes
6answers
16k views

Disable image attachment links

Is there a way to disable image attachment links trought a filter in functions.php or something ? I know it's possible to do it manually when you add an image to a post but I want to disable this ...
6
votes
4answers
31k views

What is the link to my default “archive” page?

I'm using twentyten and have overloaded home.php to do some custom stuff. However, I would still like to have a page that lists all of my recent posts, archive-style. I can get to an archive page for ...
6
votes
3answers
2k views

How to Get Next or Previous Post in a Specific Tag?

I'm trying to create links to the next and previous posts within a specific tag (on the post page itself), but I can't seem to find a plugin or source that does this. I want to be able to something ...
6
votes
5answers
2k views

Building a Digg clone using WordPress?

I am thinking of building a site similar to Digg.com (the old version). I think the best way in my case is to make a custom post type for the links and then use a a plugin such as TDO Mini Forms or ...
6
votes
1answer
2k views

Modify links when inserted by WYSIWYG editor

Is there any possibility to hook into the editor of WordPress so that if a link to an internal content is inserted via the WYSIWYG editor the post id of that linked post is added as a data attribute ...
6
votes
1answer
209 views

How can I store page ID in a post instead of other selected permalink?

We're using Wordpress as a knowledge base. We just left mediawiki and jekyll for Github pages and reduced the amount of different systems from four to just one. One Wordpress installation for blogging ...
6
votes
1answer
281 views

Is there a simple way to just insert a link to an image (without inserting an image)?

UPDATE 2018: The plugin listed below no longer works with WP (as of version 4.5 I believe) but the code listed in the accepted answer DOES still work, so use that instead. UPDATE: just found this ...
6
votes
1answer
5k views

Add a class to links in the visual editor (how to get old dialog back)

New: Old: In short, i want a list of some classes inside the add link dialog. Because this was default there might be a easy way to get it back like this? Long: I like to have the ability to add ...
5
votes
4answers
14k views

Get the prev / next page links only (not title, <a> etc)

I currently use the following method to get a prev / next blog page link: <?php previous_post_link( '%link', '%title' ); ?> However this includes the outer element, name etc, I want just the ...
5
votes
3answers
14k views

Linking a PDF as a downloadable document

How do I add a link to a PDF in the content, so that it downloads rather than opens in the browser windows? (I've uploaded the PDF to the media library and can insert the link but can't find an ...
5
votes
3answers
2k views

How to generate expiring URL?

I have a custom post type Portfolio and each portfolio is a questionnaire. If I email the link of a portfolio to a client via email. How can I expire link after 10 minutes, So if client has came ...
5
votes
1answer
2k views

Uploading Images in the Link Manager

In /wordpress/wp-admin/link-add.php there is the possibility to add an image to a link, but it belongs to the category "Advanced" and is really a little too advanced for an average user, which needs ...
5
votes
2answers
77 views

Portable Post Links

I quite often run into a situation where I develop a site on a staging domain, have my client fill it there with content, and then when everything's approved move it to production. Now, my ...
5
votes
1answer
891 views

Wondering how to turn your firefox bookmarks into a WordPress blog?

I was wondering this, too. I tried and spent quite a few hours trying, but I was finally able to proceed. I discovered a few things that won't be obvious to most people along the way, so I'm posting ...
5
votes
3answers
3k views

How to print translation supported text with HTML URL

I am somewhat new in WordPress if it is about "deeper" customization. Now I am having this function: esc_html_e( 'Dear Guest, with Your information we not find any room at the moment. Please contact ...
4
votes
7answers
29k views

How to use relative links on my pages?

In my web pages I want to use relative links instead of absolute links. However, pages do not allow php code inside them, so i cannot do to from a url in a relative manner. How does one get ...
4
votes
2answers
6k views

Default Image Link Removal

Just wondering if there is a way to remove WordPress's default function of adding a tag around an inserted image. I assume its a "remove_filter" function like you can do for WPAutoP, but all my ...
4
votes
3answers
5k views

Adding jquery and thickbox to WordPress theme

I would like to add thickbox for the template which I develop to WordPress. At this time I'm trying with a clean template that have only header.php, footer.php,index.php, and functions.php. I've ...
4
votes
1answer
2k views

Removing link '<a>' from '<li>' menu for some “links” without JS

I want some of my navigation menu items to show plain text, without a hyperlink. Usually, this code appeared: <ul class="..." id="..."> <li><a href="">my item</a> </li> &...
4
votes
1answer
2k views

Removing custom post type from link search results

I have created a custom post type and disabled it from appearing in search results. However when I add a link from a normal post, I still get these entries from my custom post type available to link ...
4
votes
1answer
3k views

What is the use of the wp_links table?

I'm wondering what is the use of the wp_links table, couldn't links have been implemented as a custom post type, if the menu system also uses custom post types?
4
votes
2answers
1k views

How to auto-approve internal pingbacks?

Whenever I write a post on my blog and link to a previous post, that pingback shows up as a comment needing to be approved. I am running Disqus, but this was happening even pre-use of that plugin. ...
4
votes
1answer
117 views

Allow user to create instances of custom field

I have a custom field for a links page which takes a name and an URL and saves it in the post meta. However, I want the user to be able to click "Add new link" and a new custom box appears so they can ...
3
votes
2answers
5k views

Wordpress: How to get the current logged in author page URL?

Is there a way to display, via a PHP function, the author posts link (myblog.com/author/jason) of the current logged in user ? In fact, I would like to display, for every logged in user, a "My ...
3
votes
1answer
8k views

How can I link to the most recent post in a category?

How can I create a link to a category--to it's most current/recent post? I want to display the actual post. I do not want to display the category with one post listing in it.I'm going to be really ...
3
votes
2answers
3k views

How to re-enable the links manager?

There is no links manager in the admin_menu of Wordpress 3.5.1 anymore. I'm creating a custom add_links_page, and I'm having a hard time with the making a plugin. Do I need to initialize something to ...
3
votes
2answers
3k views

Using filters to change href of nav menu page link

I'm trying to find a way to change the href of a nav menu page link from the parent theme's default, which goes to its relative page, to another url. For example, I have a menu link "Our Philosophy" ...
3
votes
1answer
3k views

Insert Media - Attachment - Link to : Remove the “attachment page” option

I want to remove the attachment page option from the attachment's link-to selection. I don't always want to tell my clients to avoid selecting this option, I simply want to take it out. But I am not ...
3
votes
2answers
76 views

Turning Broken URLs Into Search Terms?

I'm migrating a Typepad install to a Wordpress subdomain, and most of the links will be broken. The rewrites work so that: http://mainsite.com/blogs is rewritten to http://blogs.mainsite.com If a ...
3
votes
4answers
2k views

Open external links in a new window

Is it possible to make some sort of change or add a plugin that allows me to make every 'external' link open in a new window? Just an example: if my blog was called http//timmy.com/ and I wanted to ...
3
votes
2answers
724 views

Creating a Link Directory using WordPress?

I would like to create a dmoz like website, using WP. Any suggestions on plugins or site's architecture would be welcomed.
3
votes
1answer
913 views

opening links in new tab using - add_filter( 'the_content', 'make_clickable');

The following code in function.php, works fine for making the links - clickable, add_filter( 'the_content', 'make_clickable', 12 ); But can I make the links to open in new tab?
3
votes
1answer
5k views

get_category_link() is returning nothing

<?php $categories=get_categories('taxonomy=galeriak'); foreach ($categories as $category) { ?> <li><a href="<?php echo get_category_link( $category->term_id ) ?>" title="&...
3
votes
1answer
1k views

Count and show Clicks on external links in a single page/post

I have the following scenario I have a post that calls a table by shortcode The table contains links to outside hosts (MediaFire, Dropbox..etc) I want to track how many times all the links from that ...
3
votes
2answers
5k views

How can I find all internal links that are pointing to post/page?

I have deleted a page and now I want to find all internal links that are pointing to this deleted page. So I need to know which posts/pages have a link to the deleted page. Is there a faster way to ...
3
votes
2answers
203 views

Import and export links from WordPress.com to private site

Is there some way to export/import links from a wordpress.com site to a private site? I have a rather large directory of links. I fetch the opml file and the category levels are there, but when I use ...
3
votes
2answers
235 views

Number of External Links in Comments - Moderation Option

I just ran over a problem to properly use the count of external (meaning no relative or absolute links to my own blog) links on my blog for the Comment Moderation count Option. It's labeled Hold a ...