-
How to be a Freelance WordPress Developer
Hi there! :), your here and I hope your interested in earning money by doing freelance work. A little bit about me before we get started, I was a freelance developer for more than 3 years and I designed (some) and developed more than 40 websites. My customers were from different countries including Sri Lanka,…
-
WordPress Tip – Print parent page title and if there is no parent, print current page title.
Got this requirement on one my projects to show the Parent Page Title if there is a parent page and if there is no parent page to show the current page title. To do that use the following code, <?php echo empty( $post->post_parent ) ? get_the_title( $post->ID ) : get_the_title( $post->post_parent ); ?>
-
WordPress / PHP / Magic Fields Strip unnecessary HTML Tags while leaving the ones you want
HI Its really annoying when WordPress sometimes adds tags in multiline text inputs when you really dont need them. So to get rid of those tags you can use the following php function, strip_tags(string,allow) Here the string part refers to the string that your getting through WordPress or maybe as a Magic fields input field.…
-
qtranslate and Magic Fields custom post menu link issue
When you add a custom post created with magic fields to a custom menu, it will not show up the language url like you want to when your using qtranslate. So how to fix it? add this line to the qtranslate_hooks.php file in the plugin directory. Should be added at the bottom of the file. where…
-
How to get the upload folder in the theme files on WordPress
Ok a quick tip, How to get the upload folder in a theme file on WordPress. Why we need this? Well you might want to link to a pdf file or some static file from the theme file. How to do this? First get the upload folder into a variable, <?php $upload_dir = wp_upload_dir(); ?>…
-
WordPress Tip – Removing tags from post excerpt
OK a small tip that I found really useful. When your trying to get the excerpt of the post in WordPress site you use the following method, <?php the_excerpt(); ?> The problem with above is that it will include its own <p> or paragraph tags. There might be an occasion where you don’t wont those…
-
WordPress qtranslate plugin detect language on theme files
How to detect the language on the theme files when your using qtranslate? Well that is a good question. Why might we want to do that? well you can display diffrent contents to users based on their selected language, That’s why… 🙂 So how to do it, if(qtrans_getLanguage()==’th’) { // put your the content you…
-
WordPress Weird Character issue on exported database
Hi All, Yesterday after I uploaded one of the websites from local to staging I realized that most of the content was in some weird characters. Ex: ’, â„¢, œ The content was full of these. My normal release process is, 1- do the changes on localhost 2- upload to staging server and send to…
-
WordPress Tabs and Slides Plugin Customization
Hi Guys after a long time 🙂 I got a project that required to have a tabbed layout on its pages. This was easily achievable with numerous plugins out there. I did some research and decided to use “WordPress Tabs Slides” Plugin. After customizing it according to the customers need I realized that the url…