How to remove Base URL Duplication?

I just examined your URL http://www.homecredit.ph/wp-content/uploads/home1/homecre1/public_html/files/News-26.jpg and code and noticed that, you are saving your image in http://www.homecredit.ph/files/News-26.jpg path but trying to access from upload directory of WordPress. /home1/homecre1/public_html/files/News-26.jpg – this is the path stored in database for your attachment ID. /home1/homecre1/public_html/ – This is your root directory where WordPress installed. So better save only … Read more

List sub pages with custom field content converting image ID to URL

I ended up with this <?php //get children of page 241 and display with custom fields $args=array( ‘post_parent’ => 825, ‘post_type’ => ‘page’, ); $my_query = null; $my_query = new WP_Query($args); if( $my_query->have_posts() ) { while ($my_query->have_posts()) : $my_query->the_post(); ?> <?php $img = wp_get_attachment_image_src( get_post_meta($post->ID, ‘product_logo’, true)); ?> <?php $alt_text_for_logo = get_post_meta($post->ID, ‘alt_text_for_logo’, true); ?> … Read more

Post & Category Archives URL structure

The issue with your desired structure (and that categories without base are common request but commonly unreliable) is ambiguity. Each rewrite rule is like a tiny program, explaining WP how to turn URL into query variables. It is very important that WP can reliably distinguish which of the rules should handle particular URL. In plain … Read more

Change url to posts if they have custom tax only

It works for me. add_filter(‘post_link’, ‘locale_permalink’, 10, 3); add_filter(‘post_type_link’, ‘locale_permalink’, 10, 3); function locale_permalink($permalink, $post_id, $leavename) { if (strpos($permalink, ‘%category_slider%’) === FALSE) return $permalink; $post = get_post($post_id); if (!$post) return $permalink; if ($post->post_type != ‘post’) { return $permalink; } else { $terms = wp_get_object_terms($post->ID, ‘category_slider’); if (!is_wp_error($terms) && !empty($terms) && is_object($terms[0])) $taxonomy_slug = $terms[0]->slug; else … Read more

How to change URL of my pages?

I combined this nice solution for adding an additional option to the permalinks page and this snippet for adding a custom base name to page permalinks. Usage Save the snippet below as wpse238124-page-base.php, place it in your plugins directory, and activate Page Base on your plugins page. Then, visit your permalinks page, enter your desired … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)