The tag has no wiki summary.

learn more… | top users | synonyms

0
votes
1answer
27 views

Best way to replace image url with source

Due to a mistake the image captions have the wrong href. What would be the best way to replace the href with the image's source: post content [caption id="attachment_4900" align="aligncenter" ...
0
votes
0answers
17 views

Unable to replace text string across site

There is a text string (a little over 1000 characters with spaces) that needs to be replaced across the entire of my website. The text recurs over 300 times on my site, is identical, and was been ...
0
votes
2answers
61 views

WP function duplicating body content

I'm trying to insert content after the <body> tag using my plugin but the code I have is duplicating the <body> content. My code is at http://pastebin.com/rhDX8gsm (it's quite long) and ...
0
votes
1answer
32 views

Replace Unwanted Space in Post Content URL

I have a Wordpress site with a couple hundred posts. The posts were being created with batch processing and a piece of code was being inserted dynamically. I found an error in the URL of one of the ...
0
votes
1answer
26 views

Insert a field with PREG_REPLACE – strange behaviour

I'm trying to insert a custom field (from the Advanced Custom Fields plugin), and I need to place it within a div which I'm wrapping around an img, right before the img-tag. So basically this is the ...
0
votes
1answer
49 views

Auto Linking Words But Only One Time

I highly need a piece of code which will replace a simple word with a hypertext link, using str_replace method. And fortunately I found this code below, but the problem is that it repeats the link ...
0
votes
0answers
26 views

Search & Replace trailing strings

I need to filter the_content/the_excerpt and search & replace the following prepared array: $searchArray = array("foo", "bar", "foo bar", ...); My problem is the fact, that using php's ...
0
votes
1answer
94 views

Replace shortcode in substring

I've created these two functions to toggle between the first paragraph of the content and then everything but the first paragraph so when the user selects 'More' it slides out the article smoothly ...
1
vote
2answers
199 views

Renaming the Twenty Fourteen Wordpress theme

I know the benefits of creating child themes, but it in my case I really would like to create a theme based upon another one without any dependencies to a parent theme. I tried to use a sed command to ...
0
votes
0answers
20 views

Automatically add paragraphs in long string

I have posts ported from VBulletin. I had to stripp all VBulletin tags so now I have long strings of text with no line breaks or any br or p tags. How can I add a br br instead of each 7-th dot for ...
0
votes
1answer
39 views

GUID URL Question

I had a website that needed to be re-done, so I hosted a new dev site (not locally) with a temporary domain. The dev/new site was completed and I then moved the domain from the old site to the dev/new ...
1
vote
1answer
59 views

Remove all nav menu classes ( but keep useful ones… )

I'm trying to remove all menu-item classes (except for .current-menu-{item/parent/ancestor} and .menu-item-has-children) function custom_nav_menu_css_class($classes) { $classes = ...
0
votes
2answers
347 views

Search and replace special characters (å,ä,ö) for image attachments only in database

I need to replace the special characters å,ä,ö (with a or o) in my WP database for all image attachments. How can I apply this search and replace only to affect these links? Edit: Solved
0
votes
1answer
89 views

My Server Doesn't Allow timthumb; How Can I Remove It?

I have searched around but I've found no simple way for doing this. I have themes I bought from ReadyThemes.com that all have timthumb as the image resizer. I would prefer to use Wordpresses default ...
0
votes
1answer
119 views

replacing post ID by custom post name in url

I am stuck in replacing post ID by custom post name in url. link is as shown below: href="'.$url.'/'.$options['applyp'].'/?pos='.$post[$i]->ID.'" i need to replace ?pos='.$post[$i]->ID.' by custom ...
0
votes
1answer
182 views

how to replace embedded “full” sized images within a post with the “large” ones

There are hundreds of posts having "full" size images already published within post content. Blog contributors have uploaded very large image (some like 3000px wide) files, by design these were ...
0
votes
1answer
69 views

Replace text in excerpt

I have a separate theme for my custom WP install that will be use for mobile users, in my case I need to change an html tag in all the excerpt instances but without altering the DB, I found this ...
0
votes
1answer
558 views

Replacing &#038; in JS code on pages

I am needing to remove the &#038; that seems to be replacing my & on my page code. My original code looked like this: ...
1
vote
2answers
203 views

open all .docs in word online

Hey I'm trying to make all .doc/docx .xls/xlsx files open in office online. This would mean that every link to a .doc http://mywebsite.com/wp-content/uploads.link.doc would have to instead point ...
2
votes
1answer
164 views

Global, network-wide shortcodes or text replace functions

What I'm trying to achieve is a simple text-replace functions, that would be available to any site in my Wordpress Network. Basically I want to: Change [--] into &mdash; (—), Be able to ...
0
votes
3answers
821 views

replace html entities in posts between pre tags

I run a wordpress blog with a syntax highlighter plugin (Crayon). The plugin highlights code between pre tags, example: <pre class="lang:languageid" title="example"> some code </pre> ...
3
votes
1answer
1k views

Change html structure of all img tags in Wordpress

I have a Wordpress blog and am trying to implement the foresight.js image script. In short, I need to target all post images, swap out the src, width, & height attributes with data-src, ...
1
vote
1answer
367 views

bbpress change the word forum, topic, reply in the forum to another word I choose

bbpress I would want to customize my Forum in bbpress. by changing/replacing the words that appear on the forum layout. I would like to change the words (everywhere they appear): Forum, topic, reply. ...
1
vote
1answer
153 views

wp_editor not modify html tags of initial content

How can i set the tinyMCE editor in wp_editor to not modify/replace the html tags of the initial content ? I'm loading html content with tags (i know that they are deprecated but i need them) and ...
0
votes
2answers
118 views

About to migrate site to new domain

I've been developing a WordPress site for a client on my own hosting and domain and within the next week I'll be moving it to theirs. I have a number of questions regarding this as this is my first ...
0
votes
2answers
134 views

Replace the slug of parent pages with # [closed]

I'm creating a Wordpress site with a Superfish CSS3 / Jquery dropdown menu, complete with hoverIntent as displayed here: http://users.tpg.com.au/j_birch/plugins/superfish/#examples As far as I can ...
0
votes
3answers
1k views

echo post-permalink without http and www

I have this line … <div class="permalink"><?php the_permalink(); ?></div> and the result on my page looks like this … http://mysite.com/whatever/post-or-so I guess it could ...
1
vote
2answers
2k views

Replace image attributes for lazyload plugin (data-src)

I want to apply jquery lazyload plugin. For this to work I have to create a new attribute which is data-src place there the src value and then replace the src value with a specific value ...
1
vote
1answer
323 views

Search/Replace for editor in HTML-mode

Is there a way to do a Search and Replace for the editor in HTML-mode? Plugins I found are for the visual editor, we are working only in HTML-mode, therefore -not- appropriate for what we do. I would ...
4
votes
1answer
812 views

How to change “Draft” string for status of custom post type to “Unavailable”?

ANSWER MOD: just an important mod to the chosen answer: // check if you actually have drafts; also avoids extra '|' separator if (isset($views['draft'])) { // 'Drafts' should be added (and come ...
0
votes
1answer
677 views

is wpdb->replace() already sanitized?

i am working on a plugin that includes table in database that holds information from the different posts. right now i use $wpdb->replace(), so whenever a post is being created or updated it is also ...
1
vote
1answer
431 views

printf and _n in this example?

what is the last $count in this example? printf( _n( 'You have published %s post.', 'You have published %s posts.', $count, 'myplugin' ), $count ); i guess the first one is to fill each ...
6
votes
1answer
2k views

Moving WP install from local to live, what about wp_posts GUID?

Done this before and i am still wondering what to do with the wp_posts => guid content, which has reference to http://localhost But at wordpress.org http://codex.wordpress.org/Changing_The_Site_URL ...
0
votes
1answer
140 views

Using str_replace on wp-admin

I'm currently having some difficulties getting this below snippet to work. The current outcome is it replaces nothing. I realize this particular question could also be solved using gettext, but I was ...
1
vote
2answers
3k views

Getting rid of the #038; when string replacing content

I'm trying to add some string replacements to the_title() - function format_title($content) { $content = str_replace('&','&<br>', $content); $content = ...
0
votes
1answer
238 views

Can I change the “Home” text in the menu?

I’m pretty sure this can be done with a filter or some kind of find and replace, but I’m not sure how. I have a page called “Home” like so: When the link is displayed in my template it says ...
0
votes
1answer
46 views

How can I replace content on site generated from plugin without changing plugin

I downloaded a login form but I'd like to change its content without actually changing the plugin files so that it won't cause problems when updating later on. How can this be done?
0
votes
1answer
197 views

Extract Information from post content (using regex?)

I'm trying to replace some custom strings in my content before saving the post. I have got the $data["post_content"] which includes strings like %replaceContent:{type}% . Now I need to extract that ...
0
votes
1answer
191 views

Rename Smart YouTube's httpv back to http for all posts

I've used the Smart YouTube plugin to embed YouTube videos into my blogs. The way I did it is to replace the http:// of the YouTube url with httpv:// as the plugin describes. But now I noticed that ...
0
votes
1answer
439 views

Global MySQL replacing of text patterns/matches

I'm familiar with this method... update TABLE_NAME set FIELD_NAME = replace(FIELD_NAME, ‘find this string’, ‘replace found string with this string’); The problem is, I'm trying to do this to all ...
0
votes
2answers
1k views

MySQL: Possible to replace all of wp_posts.post_content(id#) via UPDATE + REPLACE + SELECT?

EDIT: I want to update one field (post_content) within a known record (id of 4) of a known table (wp_posts) in a new database (new_db). The update has to come from one field (post_content) within a ...
8
votes
6answers
36k views

What SQL Query to do a simple find and replace

Whenever I create a new website I first create a staging site on a subdomain like "stage.domain-name.com". After everything works correctly I export the database, open it in notepad++ and do a ...