How to set different localization file for different users?

By default WordPress only loads translations according to the user’s language when they’re viewing admin pages. You can see that in the code for the load_theme_textdomain function: $locale = apply_filters( ‘theme_locale’, is_admin() ? get_user_locale() : get_locale(), // ^^^^^^^^ $domain ); So your code is fine if you want to override that behaviour for the front … Read more

How to display latest posts with authors image

You could try something like this: <?php $args = array( ‘category’ => 12, ‘post_type’ => ‘post’ ); $postslist = get_posts( $args ); foreach ($postslist as $post) : setup_postdata($post); ?> <h2><a href=”https://wordpress.stackexchange.com/questions/318848/<?php the_permalink(); ?>”><?php the_title(); ?></a></h2> <h4><?php the_author();?></h4> <?php the_excerpt(); echo get_avatar(get_the_author_meta()); endforeach; ?> In the example the category id is set to 12 – just … Read more

Cold Fusion to WordPress

You need to learn about the WP concept of Templates and Themes. Themes are how pages are “built” and styled, and take content from the WP database as the page is Templates are part of Themes, and describe how a page specific page is built. The database is where all content is stored, including Media … Read more

Unable to delete option

You’re almost there… If you send the request to admin-post.php, then only your callback will print the response. And since your callback doesn’t print anything, then you’re getting blank screen. Most of the time what you want to do is to perform a redirect inside such callback: public function kh_update_media_seo() { delete_option(‘myoption’); wp_redirect( admin_url(‘admin.php?page=mycustomoptionspage’) ); … Read more