Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

wp pdf file short link problem

Posted on 2014-12-19
8
Medium Priority
?
164 Views
Last Modified: 2014-12-26
While working on this wordpress site, I was adding text links to pdf files.  I used the shortcode.  Problem is, that the pdf file link, when clicked on, opens up a page which then has another link to the file and it also has the site design.  

Here is an example of how I DON'T want the pdf file displayed.  Click on link to view.
http://beta.citizensequalrightsalliance.org/?attachment_id=538

There are over 20 pdf files that do this in an over 200 page website.  The other pdf files use the long code and work good.  By good, I mean the pdf file itself opens up in a new window (without the site design).

Here is how I want the pdf files to display.  Click on link to view.
http://beta.citizensequalrightsalliance.org/wp-content/uploads/2014/12/action_guide.pdf

So, my question is simple but the answer might not be.  Is there a way to do a search or setup some sort of query so that I can search for the pages that use the shortcode pdf links (I know which ones are bad) and have the wp system tell me which pages they are linked on?
0
Comment
Question by:nsitedesigns
  • 4
  • 4
8 Comments
 
LVL 70

Expert Comment

by:Jason C. Levine
ID: 40509429
Do you have direct access to the database?
0
 

Author Comment

by:nsitedesigns
ID: 40509443
my programmer does.
0
 
LVL 70

Assisted Solution

by:Jason C. Levine
Jason C. Levine earned 1500 total points
ID: 40509512
So this can be done via MySQL query.  The shortcodes are present exactly as typed in the wp_content table, post_content column.  Your programmer can do an update query using a regular expression to match the PDF shortcode and replacing it with a link.  

The trick will be generating that search/replace query.
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

Author Comment

by:nsitedesigns
ID: 40509535
Won't that also show any shortcodes that also link to pages?  I use the shortcodes for page links and those work great.  Somehow I need to id the shortcodes as ones that go to a pdf file.
0
 
LVL 70

Accepted Solution

by:
Jason C. Levine earned 1500 total points
ID: 40509540
The first step is to identify the shortcodes everywhere.  The second step is figuring out the pattern of the PDF ones to isolate just those.
0
 

Author Comment

by:nsitedesigns
ID: 40517652
We have now nearly 300 pages on this site.  Shortcodes are everywhere.  I don't know how we will be able to do what you advise since there is nothing specific about the shortcodes to the handful of links that are bad.  I will give you points anyways just for trying.
0
 
LVL 70

Expert Comment

by:Jason C. Levine
ID: 40517655
if there was no identifiable pattern for the bad shortcodes, then there really isn't any other way to do this than manual search and replaces in the database.
0
 

Author Comment

by:nsitedesigns
ID: 40518472
thanks.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
While Plesk offers many potential benefits to website administrators, including compatibility with Windows Server and other leading technologies, the company has also been working to differentiate it from other control panels for content management…
The purpose of this video is to demonstrate how to set up an RSS Feed on a WordPress Website. This will be demonstrated using a Windows 8 PC. Feedburner will be used for this demonstration. Go to your WordPress login page. This will look like the…
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…
Suggested Courses
Course of the Month21 days, 3 hours left to enroll

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question