IF you google for WordPress we will find lots of articles, even forums,… then why the hell am writing this again!!! Answer to this is i thought of sharing issues & solutions i have faced while working with wordpress 🙂 hope someone finds it useful in their path of development.
Q.
A.
Two possibilities for 404 error. One is your .htaccess file is still having your old domain or folder information, please update it and Other might be because of Permalinks, Go to sitename.com/wp-admin/ , login and Navigate to Settings->Permalinks, Verify link structure.
Q.
A.
Solution is simple. Go to sitename.com/wp-admin, login and Navigate to Settings-<General. Now update
Q.
A.
This is important task to do to avoid hackers playing with your website. This can be done only via database only because wordpress makes username filed readonly while editing. Open table wp_users table or table_prefix_users table using phpMyAdmin or any mysql tool which connects to your wordpress database.
Then use Update
Otherwise you can create a new admininstrator with your custom username, but for disabling or deleting the existing default user still you will have to do it via database,
Q.
How to remove username or name from posts in listing page?
for example,
this is my blogs first post
by Steve Jobs
this is my blogs second post by Steve Jobs
Since this is my website i dont want my name to appear for every post. how to remove this?
A.
This is common requirement faced by most wordpress users, Navigate to Appearance->Editor in admin screen. Click on entry.php, comment or remove this part,
<span><?php the_author_posts_link();/></span>
Q.
A.
Q.
A.
add_action('init', 'create_movie_genre_taxonomies'); function create_movie_genre_taxonomies() { $labels = array( 'name' => 'Genre' ); $args = array( 'labels' => $labels, 'public' => true ); register_taxonomy('genre', 'post', $args); }
Once we add the above code, we will find our new taxonomy in admin section under Post section as shown in below screen shot.
Also in add any new post & edit post, we will find this same genre as shown below.
Q.
A.
In the above code for adding custom taxonomy use ‘hierarchical’ => true attribute.
add_action('init', 'create_movie_genre_taxonomies'); function create_movie_genre_taxonomies() { $labels = array( 'name' => 'Genre' ); $args = array( 'labels' => $labels, 'public' => true, 'hierarchical' => true, ); register_taxonomy('genre', 'post', $args); }
Q.
A.
Simplest way to inherit theme or to create a child theme from parent theme is to create a new folder yourthemename under themes folder inside your wordpress and create style.cs with the following content.
style.cs
/* Theme Name: Your Child Name Description: Your Child Theme Description Author: Theme Author Name Template: ParentThemeName Version: 0.1 /* --------------------------------------------- */ @import url("../parentthemefolder/style.css");
@import url(“../parentthemefolder/style.css”); will inherit all the styles from parent theme so that alignment wont change and we can add our custom style sheets or styles in child theme style.cs to override previous styles.
functions.php is optional and other files like home.php,header.php,footer.php are optional and if added will override your parent file.
Comments (0)