Articles of replace

Name/Word Replacement Plugin

How would I go about making a plugin that allows me to write entries with real names, but display them with designated “fake” names to protect the identity of both the writer and the people being written about without the writer doing manual mapping and replacement. I also don’t want it to display without the […]

How to get “string” away – replaced with “nothing”

I am having – an issue respectively I like to try something: with this code, I get the title from a product – respectively what is stored in the database, so far: woocommerce_template_single_title(); $shaka_title = ob_get_clean(); The output is followed: <H1 CLASS=”PRODUCT_TITLE ENTRY-TITLE”>FUN DIVING – 2 DIVE’S (AROUND KOH TAO)</H1> What I need is only […]

I want to replace a word in my theme with another throughout wordpress

I have used a theme that includes the word “courses” throughout the theme by default as it is an online education platform. I am however creating a website with a similar design, but for projects so i would like to replace the word “courses” throughout the theme with the word “projects” I have minimum experience […]

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 replace all occurrances of ‘Twenty Fourteen’/’Twenty_Fourteen’/ ‘twentyfourteen’ in all files, but that just doesn’t seem […]

$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. I use $wpdb->replace function and then add $wpdb->insert_id to end of code. For Update all fields , […]

String replace WordPress Site Title

I want to get rid of a dash ‘-‘ in my WordPress site title on mobile. To do that, I want to place a span around the dash, something like the below. Desired Result <h1 class=”site-title”>My Site Title <span class=”remove-mob”>-</span> Is Great</h1> Here’s my current PHP code, can anyone suggest an edit, so that I […]

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 would have to instead point to the office online preview link I’m not even sure how to go about doing this? Any help would be greatly appreciated! Thanks!

Wrap First Character after </h3><p> in a <span> tag

This is a continuation from a question I asked earlier about doing this with output from the_excerpt(). What I am trying to do is take the following output from the_content() to take the following output as it currently is: <h3>Heading</h3> <p>Paragraph</p> And have it do the following: <h3>Heading</h3> <p><span class=”dropcap”>P</span>aragraph</p> I successfully did this with […]

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 = str_replace(‘!’,’!<br>’, $content); return $content; } add_filter(‘the_title’,’format_title’,11); When I try and replace ampersands I get an additional “#038;” after the replacement (ASCII for ampersand), I’m not sure as to why this occurs (security reason?) or how to […]

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 link to my own posts using only their titles — [internallink post=title] or anything similar. I found simple example of solving this […]