Category: wordpress

How to create widget in wordpress

How to create widget in wordpress To understand widgets in WordPress: Widgets are modular pieces of content that perform a specific task, providing an easy way to add features and features to your website without getting bogged down in complicated coding WordPress offers a variety of pre-defined widgets, but that it will monetize your site […]

Read More

Fetch wordpress post and by category id and name

Find the below best way to Fetch wordpress post and by category id and name Fetch post by cat id $posts = new WP_Query(array( ‘post_type’ => ‘post’, ‘cat’ => 11, ‘posts_per_page’ => 10, // Adjust the number of posts to display )); while ($posts->have_posts()) { $news_posts->the_post(); } For custom post ‘post_type’ => ‘latest-blog’, ‘tax_query’ => […]

Read More

How to add custom css file in theme?

How to add custom css file in theme? Add the CSS File to Your Theme: Then pase below code in functions.php function enqueue_custom1_styles() { wp_enqueue_style(‘custom-new-style’, get_template_directory_uri() . ‘/custom-newstyle.css’, array(), ‘1.0’, ‘all’); } add_action(‘wp_enqueue_scripts’, ‘enqueue_custom1_styles’); Paste code in function wp_enqueue_style (‘theme-style’, get_template_directory_uri().’/css/style.css’); Other way add_action( ‘wp_enqueue_scripts’, ‘child_enqueue_styles’); function child_enqueue_styles() { wp_enqueue_style( ‘reset-style’, get_template_directory_uri() . ‘/css/latest-blog.css’, array()); […]

Read More