The tag has no usage guidance.

learn more… | top users | synonyms

0
votes
1answer
23 views

Wp Admin Bar Customizing Labels

I would like to replace the Label the Plugin WP Custome Area sets on the admin bar. This is the initial parto of code that sets the menu title: public function build_adminbar_menu($wp_admin_bar) { ...
0
votes
1answer
41 views

Shortcode to eliminate <p> and replace </p> with <br>

I have a filter that removes opening p tags and replaces closing p tags with a br tag sitewide. The client would like this filter in a shortcode that they can use only on specific portions of the site....
-1
votes
1answer
27 views

How can you find and replace text in wordpress files on localhost xampp folders?

I am trying to do some find and replace in files tasks to my Local Wordpress installation with Xampp. But some text can't be found, for example content text. I have a multisite and I want total ...
0
votes
2answers
36 views

Problem with images URL after filter applying

I have this code in my functions.php file: function user_content_replace($content) { // it's not a URL, let's apply the replacement if (!filter_var($string, FILTER_VALIDATE_URL)) { $...
0
votes
1answer
46 views

Replace text inside a huge multidimensional array

I've a huge multidimensional array with no-way to foreach it :), Anyway, i want to replace all http to a keyword so if the client convert his website into https he won't change all old images for the ...
0
votes
1answer
68 views

Replace custom gallery shortcode with default gallery shortcode

I want to replace my custom gallery shortcode in my post content with the default Wordpress shortcode (in pre get posts). I will be doing this in only a certain instance where it will need to be ...
0
votes
0answers
26 views

Post title replacement

How do I change many post title only which are in drafts. I need to replace a list of words with another. I'm using latest WordPress version 3.9.2
0
votes
0answers
22 views

Bulk find replace to convert hundreds of old URL calls

We have a new wordpress site generated from an old html site with thousands of pages. An import process was used, but unfortunately as a result the site has hundreds of references within content to ...
1
vote
2answers
45 views

Replace / Remove Shortcode after 1st run / post

I want to use a shortcode to replace it with an image form a url. My idea: [shortcode url="http://google.de/aImage.jpg"] I post this shortcode usinbg IFTTT. After publishing the article the ...
0
votes
0answers
33 views

How to replace attached media through programmatically?

I am not sure, whether the similar question exist before. I tried to get but , couldn't get the similar question. Actually I want to replace an attached media with new image. Which Means, I am ...
0
votes
0answers
13 views

Correct way to update wp_script() url/src? [duplicate]

I tried to update the url/src of the queued $wp_scripts correctly... my aim is to use just relative paths. Therefore I: loaded the $wp_scripts replace the domain and saved the output. But it seems ...
0
votes
0answers
22 views

Is there a function like “attachment_fields_to_edit” but for “replacing” the image?

With the "attachment_fields_to_edit" function i can put custom fields to the images when i insert them in a post. The problem is, when someone clicks on "replace" he gets the "replace image" window ...
0
votes
1answer
135 views

str_replace function in theme

I am trying to change the color to red on certain words on my site. However the below code changes each word to "array". Can someone tell me what is wrong with my code? function replace_content($...
0
votes
1answer
21 views

Hide some shortcodes on posts from back-end

I searched everywhere on the web and I didn't find something that could really help me. Here is my problem; I use a plugin that provides shortcodes to show a file in a page or a post. For each file I ...
0
votes
1answer
91 views

'str_replace' and 'strtr' not working inside plugin

My goal is simple: Take a string like this --> 'https://www.secondarysite.com/subpage' And turn it into this --> 'https://www.primarysite.com/secondarysite/subpage' Sounds simple enough right? In ...
0
votes
1answer
28 views

how to replace old DW site with new WP site? [closed]

I'm new to Wordpress.org. I have an old Dreamweaver website that I want to replace with my new Wordpress.org site, using my same original URL. How do I do this? I need simple, easy-to-understand ...
0
votes
0answers
72 views

Override theme template for index page

For one of the websites I manage we baked in a lot of custom functionality into the theme we are using. The problem with this is that it's difficult to switch themes. I wanted to decouple this code ...
0
votes
1answer
19 views

How to replace part of shortlink with nothing

I am attempting to shorten the wp_get_shortlink. I want to remove the "http://" which is unnecessary. I have attempted the regular php way of (Replace("http://"," " )); but it seems WordPress has a ...
0
votes
1answer
102 views

Can't add classes using jQuery from a JSON string with get_body_class()

In order to refresh the classes on the <body>element after an AJAX call, I am writing at the top of my AJAX response the following in JSON: $o[ 'classes' ] = get_body_class('project'); I can ...
0
votes
1answer
464 views

Replace text in the Title

In a string displayed by <?php the_title(); ?> I have to replace all & characters with and. Here is the code I've tried without success: <?php $wptitle = the_title(); $wptitle = ...
0
votes
1answer
113 views

Function to replace comment's accented characters before posting

I have some weird problems with encoding my Wordpress website and I can't add comments with accent words. when i try to do it, i received error by WP. What i need is just a function that read the ...
-1
votes
1answer
51 views

Search and replace titles of posts with specific tags

I'd like to do a search and replace of post titles but only affect those with a specific tag. Eg, Change post title: This is a new post to: This is an old post but on only on posts that have the ...
1
vote
2answers
1k views

$wpdb->replace / Replace or update primary key

I write code to save data in to the database table. I want Replace a row in a table if it exists or insert a new row in a table if the row did not already exist. http://codex.wordpress.org/...
0
votes
0answers
149 views

Using $wpdb (WPDB class) 'replace' with multiple WHERE criteria problem

I have two fields that are used to identify a particular row (acting as a composite key). If it does not exist, I wish to insert a new row. The REPLACE function (http://codex.wordpress.org/...
1
vote
1answer
105 views

Search and replace in post content

I am about to change themes on my site and also a plugin that creates tabs with a post. I need to replace multi-line text with other multi-line text and can't work out how to do it. I have tried "/r/...
1
vote
1answer
115 views

Custom save button shows 'Are you sure you want to…' dialog

I'm looking for a way to replace the submitdiv meta box (publish box) with just one simple save button. By looking at Core I see there's a simple function returning a submit button: ...
0
votes
1answer
72 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" width="...
0
votes
0answers
74 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
126 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
146 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
184 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
130 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
42 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
282 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
391 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
26 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
88 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
108 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 = preg_replace('/^(...
0
votes
2answers
837 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
182 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
223 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
482 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
123 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 ...
-1
votes
1answer
1k 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: $.get("../form/master.php?called=CAP&captcha="+$("#captcha_txt").val(...
1
vote
1answer
343 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
279 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
2k 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
2k 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, data-width,...
1
vote
1answer
529 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
179 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 ...