Like Us Like Us Facebook Subscribe Subscribe us YouTube Whatsapp Share us Whatsapp Query Send your queries

Python Program to Find Prime Numbers: A Step-by-Step Guide

Python Program to Find Prime Numbers: A Step-by-Step Guide

Python Program to Find Prime Numbers: A Step-by-Step Guide, Prime numbers are fundamental in mathematics and computer science, playing a crucial role in cryptography, algorithms, and number theory. A prime number is a natural number greater than 1 that has no positive divisors other than 1 and itself. This question can be asked in CBSE Class XII’s subject Computer Science with Python.

In this blog, we’ll explore how to write a Python program to check if a number is prime and how to find all prime numbers in a given range.

What is a Prime Number?

A prime number must satisfy two conditions:

  1. It must be greater than 1.
  2. It should have no divisors other than 1 and itself.

Python Program to Find Prime Numbers:

Python Program to check if a number is Prime Number

def is_prime(n):
 if n < 2:
  return False
 for i in range(2, int(n**0.5) + 1):
  if n % i == 0:
   return False
 return True

def prime_in_range(start, end):
 for num in range(start, end + 1):
  if is_prime(num):
   print(f"{num} is a Prime number")
  else:
   print(f"{num} is not a Prime number")

# Taking input from the user
start = int(input("Enter the start of the range: "))
end = int(input("Enter the end of the range: "))

prime_in_range(start, end)

Why Learn Prime Number Programs in Python?

  1. Algorithm Efficiency: Helps in understanding optimization techniques.
  2. Cryptography: Primes are used in encryption (e.g., RSA algorithm).
  3. Competitive Programming: Frequently asked in coding interviews.
  4. Mathematical Applications: Useful in number theory problems.

Conclusion

In this blog, we learned:
What a prime number is
How to check if a number is prime in Python
Optimized prime-checking techniques
Finding all primes in a given range

Try running these programs with different inputs and see how they work!

Challenge: Can you modify the program to print non-prime numbers in a range? Try it out!

If you have and query or suggestion or need assistance  then please contact me, I will reply to fix your problem, if you like our content then you can subscribe to our Youtube channel. If you want to hire me then reach us at our Fiverr.


 

Best Insurance Adviser in Kanchrapara – Expert Guidance for Your Financial Security

Best Insurance Adviser in Kanchrapara – Expert Guidance for Your Financial Security

Looking for the best insurance adviser in Kanchrapara? Get personalized advice on life, health, motor, and travel insurance from trusted experts. Secure your future today!

Why Do You Need the Best Insurance Adviser in Kanchrapara?

Choosing the right insurance policy can be overwhelming with so many options available. A professional insurance adviser in Kanchrapara helps you navigate through various policies, ensuring you get the best coverage at the most competitive rates. Whether you need life insurance, health insurance, motor insurance, or travel insurance, an expert advisor tailors solutions to fit your needs.

Best Insurance Adviser in Kanchrapara

Key Benefits of Hiring an Insurance Adviser at Kanchrapara

  • Personalized Advice – Get customized recommendations based on your financial goals.
  • Wide Range of Options – Compare policies from top insurers like LIC, HDFC Ergo, ICICI Lombard, etc.
  • Hassle-Free Claims Assistance – Expert guidance for quick and smooth claim settlements.
  • Cost-Effective Solutions – Find the best premiums without compromising on coverage.
  • Long-Term Financial Planning – Get insights on tax benefits and future security.
  • Top Insurance Services Offered by Advisers in Kanchrapara

Top Insurance Services Offered by Advisers in Kanchrapara

Chanda eServices

Chanda eServices

Location:
Khaldhar, Kulia road
Near Kanchrapara Station

Service Provided:
All type of insurance like

  • Life Insurance – Term plans, endowment policies, ULIPs, and pension schemes.
  • Health Insurance – Individual, family floater, and critical illness coverage.
  • Motor Insurance – Comprehensive and third-party insurance for cars & bikes.
  • Travel Insurance – Domestic & international travel protection.
  • Home & Property Insurance – Coverage against fire, theft, and natural disasters.

Beside insurance also provide services like

  • Website Development
  • eCommerce Development
  • School and Institute Application
  • App development

How to Choose the Best Insurance Adviser in Kanchrapara?

✔ Check Credentials – Look for certified and experienced professionals.
✔ Read Reviews – Verify customer feedback and success stories.
✔ Compare Multiple Advisers – Assess their expertise and policy offerings.
✔ Transparency – Ensure they disclose all terms and conditions clearly.

Final Thoughts

A trusted insurance adviser in Kanchrapara can simplify your insurance journey, helping you make informed decisions for a secure future. Whether you’re buying your first policy or reviewing an existing one, expert advice ensures maximum benefits with minimal risks.

Consult the best insurance adviser in Kanchrapara today and safeguard your financial future!

If you have and query or suggestion or need assistance  then please contact me, I will reply to fix your problem, if you like our content then you can subscribe to our Youtube channel. If you want to hire me then reach us at our Fiverr.

 

Best Computer Institute in Kanchrapara Codentricks

Best Computer Institute in Kanchrapara Codentricks

Best Computer Institute in Kanchrapara, In today’s digital age, computer literacy is more important than ever before. From students seeking to improve their skills to professionals looking to upgrade their knowledge, the demand for quality computer education is on the rise. Kanchrapara, a bustling town in West Bengal, is home to several institutions that offer a variety of computer courses. Whether you’re aiming to learn basic computer operations, programming, graphic design, or even advanced software development, there are many options available.

Best Computer Institute in Kanchrapara

Why Choose a Best Computer Institute in Kanchrapara?

Kanchrapara, with its proximity to Kolkata and growing industrial and educational hubs, has become a hotspot for quality education and training. The computer institutes here offer:

  • Affordable courses
  • Experienced faculty
  • Hands-on training
  • Industry-relevant curriculum
  • Placement assistance

Whether you’re interested in basic computer skills, programming, web development, or advanced IT certifications, Kanchrapara has something for everyone.

Here’s a look at some of the

Best computer institutes in Kanchrapara that can help you achieve your tech aspirations.

CODENTRICKS (The Smart Coding Solution)

Overview: Codentricks is a  recognized name in IT training,  It offers a wide range of courses, from basic computer literacy to advanced programming and software development.

Courses Offered:

  • Basic Computer Course
  • Programming in C, C++, Java, Python
  • WordPress Development
  • Node.JS, MongoDB
  • Devops
  • Btech Computer Science, MCA Project

Highlights:

  • Industry-aligned curriculum
  • Experienced trainers
  • Not provide any Government approved certificate
  • Only Focus on learning

Location: Near Kanchrapara Railway Station

How to contact :  Leave a mail at [email protected]

Ximat (Xzen Institute of Media and Technology)

Overview: Ximat is another leading name in the IT education sector, known for its innovative teaching methods and comprehensive courses. The Kanchrapara center provides a conducive learning environment for students and professionals alike.

Courses Offered:

  • Diploma Course In Graphic Design & Web
  • Diploma Course In Multimedia
  • Certificate Course For Advanced Video Editing
  • WordPress Development
  • Office Management
  • B tech Computer Science, MCA Internship

Highlights:

  • State-of-the-art infrastructure
  • Flexible batch timings

Placement assistance with top IT companies

Location: 34/A Borojonepur,
Kanchrapara, North 24 PGS,
Pin – 743145, West Bengal

How to contact :  Leave a mail at [email protected]

Conclusion

Kanchrapara has no shortage of excellent computer institutes that cater to a diverse range of learning needs. Whether you’re a student, a professional, or someone looking to learn new skills, these institutes offer quality education that will help you succeed in today’s technology-driven world. Choose the one that best fits your learning style, career aspirations, and budget, and take the first step toward mastering the digital world.

With the right computer education, your future in the tech world is bright—don’t wait to get started!

If you have and query or suggestion or need assistance  then please contact me, I will reply to fix your problem, if you like our content then you can subscribe to our Youtube channel. If you want to hire me then reach us at our Fiverr.

Python Dictionary Tutorial: How Do I Add and Change Items?

Python Dictionary Tutorial: How Do I Add and Change Items?

Python Dictionary Tutorial, Dictionaries are one of the most powerful and versatile data structures in Python. They allow you to store and manage data in key-value pairs, making it easy to retrieve and manipulate information efficiently. Whether you’re a beginner or an experienced developer, understanding dictionaries is essential for writing clean and effective Python code. In this tutorial, we’ll cover everything you need to know about Python dictionaries, from basic operations to advanced techniques.

Python Dictionary Tutorial

What are Python Dictionary?

At its core, a Python dictionary is a collection of key-value pairs. Think of it like a real-world dictionary: you look up a word (the “key”) to find its definition (the “value”). In Python, keys must be unique and immutable (like strings, numbers, or tuples), while values can be of any data type.

Creating a Python Dictionary

You can create a dictionary using curly braces {} or the dict() constructor.

# Using curly braces
cr_dict = {"name": "Raunak Gupta", "age": 45, "city": "Kolkata"}
# Using the dict() constructor
cro_dict = dict(name="Raunak Gupta", age=27, city="New Delhi")

Accessing Values in a Python dictionary

To access a value in a dictionary, you use the corresponding key within square brackets [].

# Creating a simple dictionary
person = {
    "name": "Sanjay",
    "age": 30,
    "city": "Buxar"
}
print(person["name"])  # Output: Sanjay
print(person["age"])   # Output: 30
#Using .get() to avoid errors if the key doesn't exist.
print(person.get("job", "Unknown")) #Output: Unknown, since job doesn't exist.

Adding or Modifying a Python Dictionary

You can add, update, or delete key-value pairs easily.

my_dict = {"name": "Virat", "age": 14, "city": "Kanchrapara"}
# Adding a new key-value pair
my_dict["email"] = "[email protected]"
# Updating an existing key
my_dict["age"] = 26
# Removing a key-value pair
my_dict.pop("city")
# Using del to remove a key
del my_dict["email"]

Iterating Through a Python Dictionary

You can loop through a dictionary using for loops to access keys, values, or both.

student = {"name": "SANJAY", "age": 21, "course": "Computer Science","grade": "A"}
# Iterating through keys
for key in student:
    print(key)
# Output: name, age, course
# Iterating through values
for value in student.values():
    print(value)
# Output: SANJAY, 21, Computer Science
# Iterating through key-value pairs
for key, value in student.items():
    print(f"{key}: {value}")
# Output: name: SANJAY, age: 21, course: Computer Science

Python Dictionary Methods

Python dictionaries come with a variety of useful methods:

  • keys(): Returns a view object containing the dictionary’s keys.
  • values(): Returns a view object containing the dictionary’s values.
  • items(): Returns a view object containing 1 key-value pairs as tuples.

COMPUTER SCIENCE WITH PYTHON BOOKS DOWNLOAD

CLICK HERE

If you have and query or suggestion or need assistance  then please contact me, I will reply to fix your problem, if you like our content then you can subscribe to our Youtube channel. If you want to hire me then reach us at our Fiverr.

Top Computer Institutes Kanchrapara: Your Gateway to a Tech-Driven Future

Top Computer Institutes Kanchrapara: Your Gateway to a Tech-Driven Future

Top Computer Institutes Kanchrapara: Your Gateway to a Tech-Driven Future

In today’s digital age, computer literacy and technical skills are no longer optional—they are essential. Whether you’re a student looking to build a career in IT, a professional aiming to upskill, or someone exploring the world of technology, enrolling in a reputable computer institute can be a game-changer. If you’re in Kanchrapara, a bustling town in West Bengal, you’re in luck! The town is home to several top computer institutes that offer a wide range of courses to cater to your needs. In this blog, we’ll explore the best computer institutes in Kanchrapara and what makes them stand out.

Why Choose a Top Computer Institute in Kanchrapara?

Kanchrapara, with its proximity to Kolkata and growing industrial and educational hubs, has become a hotspot for quality education and training. The computer institutes here offer:

  • Affordable courses
  • Experienced faculty
  • Hands-on training
  • Industry-relevant curriculum
  • Placement assistance

Whether you’re interested in basic computer skills, programming, web development, or advanced IT certifications, Kanchrapara has something for everyone.

Top computer institute in Kanchrapara fee structure

Course fee structure at various computer institute at Kanchrapara divided as given below

  • Registration Fee
  • Admission Fee
  • Tuition Fee
  • Examination Fee
  • Certificate Fee

Top computer institute in kanchrapara fees

Course fee depends on type of courses is given below

  • School courses ranges ₹700-1000 pm
  • Computer Science with Python Class XI and XII (CBSE) :  ₹1000-1500 pm
  • Profession multimedia courses : ₹15,000-100,000
  • Coding or Programming: ₹15,000-150,000
  • Cloud Computing like AWS, Devops, Data Science: ₹15,000-100,000

Top Computer Institutes in Kanchrapara List:

Top Computer Institutes Kanchrapara

CODENTRICKS (The Smart Coding Solution)

Overview: Codentricks is a  recognized name in IT training, and its Kanchrapara branch lives up to the reputation. It offers a wide range of courses, from basic computer literacy to advanced programming and software development.

Courses Offered:

  • Basic Computer Course
  • Programming in C, C++, Java, Python
  • WordPress Development
  • Node.JS, MongoDB
  • Devops
  • Btech Computer Science, MCA Project

Highlights:

  • Industry-aligned curriculum
  • Experienced trainers
  • Not provide any Government approved certificate
  • Only Focus on learning

Location: Near Kanchrapara Railway Station

How to contact :  Leave a mail at [email protected]

Ximat (Xzen Institute of Media and Technology)

Overview: Ximat is another leading name in the IT education sector, known for its innovative teaching methods and comprehensive courses. The Kanchrapara center provides a conducive learning environment for students and professionals alike.

Courses Offered:

  • Diploma Course In Graphic Design & Web
  • Diploma Course In Multimedia
  • Certificate Course For Advanced Video Editing
  • WordPress Development
  • Office Management
  • Btech Computer Science, MCA Intership

Highlights:

  • State-of-the-art infrastructure
  • Flexible batch timings

Placement assistance with top IT companies

Location: 34/A Borojonepur,
Kanchrapara, North 24 PGS,
Pin – 743145, West Bengal

How to contact :  Leave a mail at [email protected]

If you have and query or suggestion or need assistance  then please contact me, I will reply to fix your problem, if you like our content then you can subscribe to our Youtube channel. If you want to hire me then reach us at our Fiverr.

SSC GD Answer Key 2025: Everything You Need to Know

SSC GD Answer Key 2025: Everything You Need to Know

SSC GD Answer Key 2025: Everything You Need to Know

The Staff Selection Commission (SSC) General Duty (GD) Constable exam is one of the most sought-after competitive exams in India. Every year, lakhs of candidates appear for this exam to secure a position in the paramilitary forces, including BSF, CRPF, CISF, ITBP, SSB, and more. One of the most crucial steps in the examination process is the release of the SSC GD Answer Key. In this blog post, we’ll cover everything you need to know about the SSC GD Answer Key, including its importance, how to download it, and how to raise objections if needed.

SSC GD Answer Key 2025

What is the SSC GD Answer Key?

The SSC GD Answer Key is an official document released by the Staff Selection Commission after the completion of the examination. It contains the correct answers to all the questions asked in the SSC GD Constable exam. Candidates can use the answer key to calculate their expected scores and assess their performance before the official results are declared.
Importance of the SSC GD Answer Key

Self-Evaluation:

The answer key allows candidates to compare their responses with the correct answers and estimate their scores.

Transparency:

It ensures transparency in the evaluation process, as candidates can verify the correctness of the answers.

Objection Raising:

If candidates find any discrepancies in the answer key, they can raise objections within a specified time frame.

Result Prediction:

By calculating their expected scores, candidates can get an idea of their chances of qualifying for the next stage.

Steps to Download the SSC GD Answer Key

The SSC GD Answer Key is usually released on the official SSC website (https://ssc.nic.in). Here’s how you can download it:

Visit the Official Website:

Direct link to Download SSC GD Answer Key

Click here

Navigate to the Answer Key Section:

Look for the “Answer Key” or “Latest Updates” section on the homepage.

Find the SSC GD Answer Key Link:

Click on the link for the SSC GD Constable Answer Key.

Enter Your Credentials:

You may need to enter your roll number, date of birth, or other details to access the answer key.

Download and Save:

Download the answer key and save it for future reference.

How to Calculate Your Marks Using the SSC GD Answer Key

To calculate your expected score, follow these steps:

Check the Correct Answers:

Compare your responses with the answers provided in the answer key.

Marking Scheme:

The SSC GD exam follows a negative marking scheme:

Correct Answer: +1 mark

Incorrect Answer: -0.25 marks

Unanswered Question: 0 marks

Calculate Your Score:

Add 1 mark for each correct answer.

Subtract 0.25 marks for each incorrect answer.

Leave unanswered questions as they are.

Total Your Score:

Add up all the marks to get your expected score.

How to Raise Objections Against the SSC GD Answer Key

If you find any discrepancies in the answer key, you can raise objections by following these steps:

Check the Official Notification:

The SSC releases a notification along with the answer key, specifying the process and timeline for raising objections.

Pay the Objection Fee:

For each question challenged, you may need to pay a nominal fee (usually ₹100 per question).

Submit Your Objection:

Provide valid proof or references (e.g., textbooks, study materials) to support your objection.

Wait for the Final Answer Key:

After reviewing all objections, the SSC releases the final answer key, which is used to prepare the results.

Important Points to Remember

SSC GD Answer Key Release Date:  4th March 2025

The SSC GD Answer Key is usually released within a few weeks after the exam. Keep an eye on the official website for updates.

Final Answer Key:

The final answer key is considered final and is used to prepare the results. No further objections are entertained after its release.

Result Declaration:

The SSC GD results are declared based on the final answer key. Candidates who qualify are called for the next stage, which includes Physical Efficiency Test (PET) and Medical Examination.

Stay Updated:

Regularly check the SSC website and official notifications for updates on the answer key and results.

Conclusion

The SSC GD Answer Key is an essential tool for candidates to evaluate their performance and predict their results. By understanding how to download the answer key, calculate your marks, and raise objections, you can ensure a smooth and transparent examination process. Stay focused, keep practicing, and best of luck for your SSC GD Constable exam!

For more updates and tips on competitive exams, stay tuned to our blog. If you have any questions or need further assistance, feel free to leave a comment below!

SSC GD Answer Key

IGNOU MCA What is inventory? What are the reasons

IGNOU MCA What is inventory? What are the reasons

IGNOU MCA: What is inventory? What are the reasons for holding inventory? Explain the traditional techniques of
inventory control.

IGNOU MCA: What is Inventory?

Inventory refers to the stock of goods, materials, or products that a business holds for the purpose of resale, production, or future use. It is a critical component of supply chain management and can include raw materials, work-in-progress (WIP), and finished goods.

IGNOU MCA What is inventory

IGNOU MCA What are the reasons for holding inventory?

Businesses hold inventory for several reasons, including:

Meeting Customer Demand:

Ensures products are available when customers need them, preventing stockouts and lost sales.

Buffer Against Uncertainty:

Acts as a safety net against unpredictable demand, supply chain disruptions, or delays in production.

Economies of Scale:

Bulk purchasing or production reduces per-unit costs, making inventory holding cost-effective.

Seasonal Demand:

Businesses stock up in anticipation of seasonal peaks (e.g., holiday sales, festivals).

Production Smoothing:

Maintains a steady flow of materials for production processes, avoiding downtime.

Lead Time Reduction:

Reduces the time between order placement and delivery, improving customer satisfaction.

Price Fluctuations:

Businesses may stock up when prices of raw materials are low to avoid future price increases.

Traditional Techniques of Inventory Control

Inventory control involves managing and optimizing inventory levels to balance costs and service levels. Traditional techniques include:
1. ABC Analysis

Concept: Classifies inventory into three categories based on their value and importance:

  • A Items: High-value items with low sales frequency (tight control).
  • B Items: Moderate-value items with moderate sales frequency.
  • C Items: Low-value items with high sales frequency (minimal control).
  • Purpose: Focuses resources on managing high-value items more effectively.

2. Economic Order Quantity (EOQ)

Concept: Determines the optimal order quantity that minimizes total inventory costs (ordering and holding costs).

Formula:

 

Purpose: Balances ordering and holding costs to reduce overall expenses.

3. Reorder Point (ROP)

Concept: The inventory level at which a new order should be placed to replenish stock before it runs out.

Formula:
ROP=Lead Time Demand+Safety Stock

Purpose: Ensures timely replenishment to avoid stockouts.

4. Safety Stock

Concept: Extra inventory held to protect against uncertainties in demand or supply.

Purpose: Reduces the risk of stockouts due to unexpected demand spikes or delays.

5. First-In, First-Out (FIFO)

Concept: Assumes that the oldest inventory (first in) is sold or used first (first out).

Purpose: Prevents obsolescence and ensures inventory freshness, especially for perishable goods.

6. Just-In-Time (JIT)

Concept: Inventory is ordered and received only when needed, minimizing holding costs.

Purpose: Reduces waste and improves efficiency, though it requires reliable suppliers.

7. Periodic Review System

Concept: Inventory levels are reviewed at fixed intervals, and orders are placed to bring stock up to a target level.

Purpose: Simplifies inventory management for businesses with predictable demand.

8. Perpetual Inventory System

Concept: Inventory levels are continuously tracked in real-time using technology (e.g., barcode scanners, RFID).

Purpose: Provides accurate, up-to-date inventory data for better decision-making.

If you have and query or suggestion or need assistance  then please contact me, I will reply to fix your problem, if you like our content then you can subscribe to our Youtube channel. If you want to hire me then reach us at our Fiverr.

 

Aiims kalyani booking an appointment online

Aiims kalyani booking an appointment online

Aiims kalyani booking an appointment online

Do you want to visit AIIMS Kalyani is a Multi specialty Hospital in Nadia. Getting  booking is a very difficult task and people try to book throught Aiims booking number and their app but they are not able to get get due to huge demand.

Theres is two way for booking an appointment,

  1. Calling
  2. Through Aiims Official App

Aiims kalyani booking an appointment online

Aiims kalyani booking an appointment online through Calling

The phone number for booking an appointment at AIIMS Kalyani is 033 29516005. The Out-Patient Department (OPD) is open Monday to Friday from 9 AM to 1 PM, and OPD registration is available from 8 AM to 11 AM. OPD services are not available on weekends(Saturday, Sunday) or central government holidays.

Aiims kalyani booking an appointment online through App

You can also register for an appointment through the AIIMS Kalyani Swasthya app, which is available on the Google Play store. To download you can click here .

How to book appointment through App:

  1. Go to the Play Store and download the AIIMS Kalyani Swasthya App.
  2. Now install the app on your device and complete the registration process by using your Mobile number.
  3. Kindly open the app and click on the Booking Online Appointment.
  4. After that, you have to enter the patient details like Name, Age, Gender, Mobile No, Address, etc.
  5. Let’s select the Department according to your disease.
  6. Then you need to pick up the date and time when you want to visit the OPD.
  7. Finally, you will receive the Outdoor Ticket on your registered number.

Aiims Kalyani Address :

NH – 34 Connector,
Basantapur, Saguna
West Bengal – 741245

Aiims Kalyani Email ID :

[email protected]

Aiims Kalyani Contact No.  :

Phone: 033 – 29516005, 033 29991581, 033 29991583, 033 29991576

If you have and query or suggestion or need assistance  then please contact me, I will reply to fix your problem, if you like our content then you can subscribe to our Youtube channel. If you want to hire me then reach us at our Fiverr.

 

How to Create a Custom Post Type in WordPress

How to Create a Custom Post Type in WordPress

How to Create a Custom Post Type in WordPress programmatically, If you are a word press developer some time you need to do some thing different, you can’t do every thing in elementor or WP Bakery, word press comes with custom post so first thing is know that What is WordPress custom post ?

How to Create a Custom Post Type

Custom Post Type in WordPress

A custom post type (also known as CPT) in WordPress is a feature that allows users to define their own content types beyond the default posts and pages. There are some default post type are :

  1. Post
  2. Page
  3. Attachment
  4. Revision
  5. Nav Menu

Some times we need to create a our own custom post. We can create a custom post in 2 way

  1. Using Plugin
  2. Custom Code

How to Create a Custom Post Type in WordPress using Plugins

If you don’t want to code, still you can create word press custom post using plugins like CPT UI and you want create custom filed then use Advanced custom field plugin.

How to Create a Custom Post Type in WordPress using Custom PHP Code

If you want to create a custom post type in wordpress programmatically then you need add the php code give below to your theme’s functions.php file

// Our custom post type function
function bestDeal_custom_post_type() {

register_post_type( 'product',
// CPT Options
array(
'labels' => array(
'name' => __( 'Best Deals' ),
'singular_name' => __( 'Best Deal' )
),
'public' => true,
'has_archive' => true,
'rewrite' => array('slug' => 'best_deal'),
'show_in_rest' => true,

)
);
}
// Hooking up our function to theme setup
add_action( 'init', 'bestDeal_custom_post_type' );

Reading code’s comment you can understand the code easily. still you have ant query then let me know through your comments, I will try to answer your queries.

If you have and query or suggestion or need assistance  then please contact me, I will reply to fix your problem, if you like our content then you can subscribe to our Youtube channel. If you want to hire me then reach us at our Fiverr.

Create a wordpress page programmatically and Assign Elementor Full Width Template

Create a wordpress page programmatically and Assign Elementor Full Width Template

With the help of  code given below, you can create dynamic page programitically in Word press. In this tutorial, I will create post programitically and assign elementor’s Full width Template.

create a wordpress page programmatically

Create a wordpress page programmatically and Assign Elementor Full Width Template Code:

add_action('init', 'codentricks_create_pg',"");
function codentricks_create_pg($value){
$assignE=sanitize_text_field($_POST['assignE']);
$wordpress_page = array(
'post_title' => $value,
'post_content' => '<h1>Content will be updated soon</h1>',
'post_status' => 'publish',
'post_author' => 1,
'post_type' => 'page'
);
//wp_insert_post( $wordpress_page );

$new_page_id = wp_insert_post( $wordpress_page );

if($assignE=='Elementor'):

if( defined( 'ELEMENTOR_VERSION' ) ) //-- if FREE version of Elementor plugin is installed
{
update_post_meta( $new_page_id, '_elementor_version', ELEMENTOR_VERSION );
update_post_meta( $new_page_id, '_wp_page_template', 'elementor_header_footer');
update_post_meta( $new_page_id, '_elementor_edit_mode', 'builder' );
update_post_meta( $new_page_id, '_elementor_template_type', 'wp-page' );
}

if( defined( 'ELEMENTOR_PRO_VERSION' ) ) //-- if PRO version of Elementor plugin is installed
{
update_post_meta( $new_page_id, '_elementor_pro_version', ELEMENTOR_PRO_VERSION );
update_post_meta( $new_page_id, '_wp_page_template', 'page-fullwidth.php' ); //-- for using full width template
update_post_meta( $new_page_id, '_elementor_edit_mode', 'builder' );
update_post_meta( $new_page_id, '_elementor_template_type', 'wp-page' );
}

endif;
// action ends
if(isset($_POST['codentrick_submit'])){
echo '<div class="card">';
$field_values_array = $_POST['field_name'];
$i=1;
$msg="";
foreach($field_values_array as $value){
//echo $value;
$value=sanitize_text_field($value);
if($value!=""){
codentricks_create_pg($value);
$msg.=$i." ". $value."<br/>";
$i++;
}
}
echo "<strong>Created Pages :</strong><br/>".$msg;
echo '</div>';
}

Create a wordpress page programmatically and Assign Elementor Full Width Template HTML Code:

<form action="" method="post">
<div class="field_wrapper">
<div style="margin-bottom:5px;">
<input type="text" name="field_name[]" value="" class="codeField" placeholder="Page Title" autofocus/>
<a href="javascript:void(0);" class="add_button" title="Add field"><i class="dashicons dashicons-insert"></i></a>
</div>
</div>
<div class="buttonCode">
<div style="margin-bottom:10px;">
<select name="assignE" id="assignE" required>
<option value="">Select Option</option>
<option value="None"> WordPress Defult Editor</option>
<option value="Elementor">Elementor (Full Width)</option>
</select>
</div>
</div>
<div class="buttonCode">
<input type="submit" name="codentrick_submit" class="button button-primary" value="Create Pages">
</div>
</form>

You can use this code in word press and generate dynamic page and assign pages to WordPress Default Editor or Elementor Full width Template.

If you have and query or suggestion or need assistance  then please contact me, I will reply to fix your problem, if you like our content then you can subscribe to our Youtube channel. If you want to hire me then reach us at our Fiverr.