Magento and WordPress URL integration [closed]

As far as I know, having a subfolder in your URL for your blog does not cause decreasing in your Google rankings. And, having /blog/ in your URL is totally logical for you and your users, and SEO is all about logic, semantic and other stuff.

Where to place PHP for shortcodes

Shortcodes are processed on display so the code must be available on the front end when the shortcode is processed. Superficially, that means frontend.php. I have never tried to split shortcode code in this way. You may have trouble splitting it off from the backend. The add_shortcode function is in wp-includes/shortcodes.php which loads for both … Read more

need help to arabic text in wordpress

Make sure all your files are encoded in UTF-8. Keep your theme language agnostic: Write all strings in English and use the proper translation functions to get the translated string (eg. Arabic): _e( ‘Hello world!’, ‘your_text_domain’ );

Outputting a custom field in PHP

Setting the third parameter of get_post_meta to true does not guarantee that you get a string. What that parameter does is control how many rows of the database get returned. When true you only get a single result and not an array of all of the rows in the database that match. You will get … Read more

Highlight main menu when on specific posts or pages

As noted in comments above, the OP’s code generates malformed CSS. Per request, here is corrected code. It should help solve part of the issue (or prevent other issues) but I doubt it solves all of it. function blog_link_genesis() { if( is_single() || in_category(‘investors’) || is_page( array(4, 30))) { $current=”#header #nav #menu-item-133 a”; ?> <style … Read more

two sites, same code, different presentation

After walking through the code and examining everything else, I (finally) revisited the page definition in the Dashboard. There I noticed that the page was not associated with the page template I was working with. I assume that during the migration from the development web site to the production web site, the association went missing. … Read more

Restricting Post Content Visibility with Custom Code – where to put it?

you can place your function in functions.php and attach an action hook . which will decide when to call your function. If you only want to hide content of the posts you can use this hook add_action(‘the_content’, ‘yourcustomfunction’) or i would suggest this hook which will be called before your actually post query is run … Read more

Create new folder and upload files to custom folder via wp_handle_upload

This isn’t a working example but should help, Use wp_upload_dir() to define the default uploads folder and append a username to it using wp_get_current_user. $wp_upload_dir = wp_upload_dir(); $user_folder = wp_get_current_user(); // The actual folder $custom_upload_folder= $wp_upload_dir[‘basedir’] . $user_folder->display_name; //make the dir mkdir($custom_upload_folder); You would need to employ security and code that checks for errors/user capabilities … Read more