Anandaraj Balu
Forum Replies Created
-
Forum: Developing with WordPress
In reply to: Creating a post loop on homepage?If you want to display the posts by adding short code use the below function to your functions.php
Short code: [all_post]
add_shortcode('all_post','HomeAllposts'); function HomeAllposts(){ global $post; $args = array('orderby'=>'post_date','order'=> 'DESC', 'posts_per_page' => -1,'post_type'=>'post' ); $myposts = get_posts( $args ); foreach( $myposts as $key => $post ){ setup_postdata($post);?> <h1><?php the_title(); ?></h1> <?php the_excerpt(); ?> <a href="<?php the_permalink(); ?>">More</a> <?php }wp_reset_postdata(); }
Otherwise want to use template, use the code at template where you want.
global $post; $args = array('orderby'=>'post_date','order'=> 'DESC', 'posts_per_page' => -1,'post_type'=>'post' ); $myposts = get_posts( $args ); foreach( $myposts as $key => $post ){ setup_postdata($post);?> <h1><?php the_title(); ?></h1> <?php the_excerpt(); ?> <a href="<?php the_permalink(); ?>">More</a> <?php }wp_reset_postdata();
- This reply was modified 8 years, 1 month ago by Anandaraj Balu.
Forum: Developing with WordPress
In reply to: User area data display$blogusers = get_users( 'blog_id=1&orderby=nicename&role=subscriber' ); // Array of WP_User objects. foreach ( $blogusers as $user ) { echo '<span>' . esc_html( $user->user_email ) . '</span>'; }
It returns all default user meta.
For get default and custom user meta refer below link
user_meta- This reply was modified 8 years, 1 month ago by Anandaraj Balu.
Forum: Fixing WordPress
In reply to: mysqli_query()I dont have error log in MYSQL and i need to check nw logs.
thanks for your valuable replies, Great!
Forum: Fixing WordPress
In reply to: mysqli_query()Following errors in log file.
PHP Warning: mysqli_query(): MySQL server has gone away in C:\\Apache24\\htdocs\\wordpress\\wp-includes\\wp-db.php on line 1877, referer:
- This reply was modified 8 years, 1 month ago by Anandaraj Balu.
- This reply was modified 8 years, 1 month ago by Anandaraj Balu.
- This reply was modified 8 years, 1 month ago by Anandaraj Balu.
Forum: Fixing WordPress
In reply to: mysqli_query()Great reply,
I have tried connection with php mysqli, no drop between servers.
Now i installed new wordpress instance and i able login to dashboard but i got following on dashboard.
Warning: mysqli_query(): MySQL server has gone away in C:\Apache24\htdocs\wordpress\wp-includes\wp-db.php on line 1877 Warning: mysqli_query(): Error reading result set's header in C:\Apache24\htdocs\wordpress\wp-includes\wp-db.php on line 1877 Warning: mysqli_query(): MySQL server has gone away in C:\Apache24\htdocs\wordpress\wp-includes\wp-db.php on line 1877 Warning: mysqli_query(): Error reading result set's header in C:\Apache24\htdocs\wordpress\wp-includes\wp-db.php on line 1877
On dashboard not able to upload, delete theme and plugins.
Not able to create menus.
Forum: Fixing WordPress
In reply to: mysqli_query()Thanks for your reply,
I used IP only at DB HOST, I dont know what was issue…
- This reply was modified 8 years, 1 month ago by Anandaraj Balu.
- This reply was modified 8 years, 1 month ago by Anandaraj Balu.
Forum: Fixing WordPress
In reply to: Anchor Tags vs Jump Links<a href="https://www.remarpro.com">
: This will redirect to given target url.
<a href="#target_id">
: This will target you to the given id section.Forum: Fixing WordPress
In reply to: 403 Forbidden. Access to this resource on the server is deniedIt may occur by plugins, just rename your plugin folder and try.
Forum: Fixing WordPress
In reply to: How to Add an Image/Banner Below HeaderHi,
You can call the image top of the /my-temp/ page template.
Forum: Hacks
In reply to: Post css colors based on category?Hi,
In this case you need to write custom post loops.
Forum: Fixing WordPress
In reply to: Redirect loop after changing nameserver.I have changed the site url http to https in general setting, no change.
Forum: Fixing WordPress
In reply to: A custom sidebar for widgetsYou not suppose to use this code in functions.php
<?php dynamic_sidebar( ‘sidebar-id’ ); ?>
Use it on template files.
Forum: Fixing WordPress
In reply to: A custom sidebar for widgetsHi,
After widget registration you need use following code to display widget content.
<?php dynamic_sidebar( ‘sidebar-id’ ); ?>
‘sidebar-id’ Is registered sidebar id. (Ex:sidebar-4)
Hi rsmylf,
Create a db and import the downloaded db on your pc.
Place the wordpress files to your server folder.
Open the file wp-config.php and change the below mentioned.
/** MySQL database username */
define(‘DB_USER’, ‘root’);/** MySQL database password */
define(‘DB_PASSWORD’, ”);/** MySQL hostname */
define(‘DB_HOST’, ‘localhost’);Go to db and navigate wp_options table.
Browse the table finally change the value siteurl and homeurl
Forum: Fixing WordPress
In reply to: Warning: Cannot modify header information – headers already sent byPlace the function ob_start(); top of the functions and end with
return ob_get_clean();