<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>WordPress Plugin Development Archives - Artificial Intelligence</title>
	<atom:link href="https://www.aiuniverse.xyz/tag/wordpress-plugin-development/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.aiuniverse.xyz/tag/wordpress-plugin-development/</link>
	<description>Exploring the universe of Intelligence</description>
	<lastBuildDate>Thu, 18 Jan 2024 09:26:35 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>
	<item>
		<title>Create a plugin to always display and center the current post&#8217;s featured image</title>
		<link>https://www.aiuniverse.xyz/create-a-plugin-to-always-display-and-center-the-current-posts-featured-image/</link>
					<comments>https://www.aiuniverse.xyz/create-a-plugin-to-always-display-and-center-the-current-posts-featured-image/#respond</comments>
		
		<dc:creator><![CDATA[Maruti Kr.]]></dc:creator>
		<pubDate>Thu, 18 Jan 2024 09:26:33 +0000</pubDate>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Centered Image Plugin]]></category>
		<category><![CDATA[Custom WordPress Functionality]]></category>
		<category><![CDATA[Featured Image Display]]></category>
		<category><![CDATA[Post Content Customization]]></category>
		<category><![CDATA[Post Styling]]></category>
		<category><![CDATA[User Experience Improvement]]></category>
		<category><![CDATA[Visual Enhancement]]></category>
		<category><![CDATA[Visual Presentation Plugin]]></category>
		<category><![CDATA[WordPress Development Tutorial]]></category>
		<category><![CDATA[WordPress Plugin Development]]></category>
		<guid isPermaLink="false">https://www.aiuniverse.xyz/?p=18451</guid>

					<description><![CDATA[<p>Here&#8217;s an example of a plugin that you can use to always display and center the current post&#8217;s featured image in WordPress: Step 1: Create a new <a class="read-more-link" href="https://www.aiuniverse.xyz/create-a-plugin-to-always-display-and-center-the-current-posts-featured-image/">Read More</a></p>
<p>The post <a href="https://www.aiuniverse.xyz/create-a-plugin-to-always-display-and-center-the-current-posts-featured-image/">Create a plugin to always display and center the current post&#8217;s featured image</a> appeared first on <a href="https://www.aiuniverse.xyz">Artificial Intelligence</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>Here&#8217;s an example of a plugin that you can use to always display and center the current post&#8217;s featured image in WordPress:</p>



<p><strong>Step 1:</strong> Create a new directory in your WordPress plugins folder. Let&#8217;s name it center-featured-image.</p>



<figure class="wp-block-image size-full"><img fetchpriority="high" decoding="async" width="847" height="505" src="https://www.aiuniverse.xyz/wp-content/uploads/2024/01/image-47.png" alt="" class="wp-image-18452" srcset="https://www.aiuniverse.xyz/wp-content/uploads/2024/01/image-47.png 847w, https://www.aiuniverse.xyz/wp-content/uploads/2024/01/image-47-300x179.png 300w, https://www.aiuniverse.xyz/wp-content/uploads/2024/01/image-47-768x458.png 768w" sizes="(max-width: 847px) 100vw, 847px" /></figure>



<p><strong>Step 2:</strong> Inside the center-featured-image directory, create a PHP file (e.g., center-featured-image.php) with the following code:</p>



<figure class="wp-block-image size-large"><img decoding="async" width="1024" height="604" src="https://www.aiuniverse.xyz/wp-content/uploads/2024/01/image-49-1024x604.png" alt="" class="wp-image-18454" srcset="https://www.aiuniverse.xyz/wp-content/uploads/2024/01/image-49-1024x604.png 1024w, https://www.aiuniverse.xyz/wp-content/uploads/2024/01/image-49-300x177.png 300w, https://www.aiuniverse.xyz/wp-content/uploads/2024/01/image-49-768x453.png 768w, https://www.aiuniverse.xyz/wp-content/uploads/2024/01/image-49.png 1165w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p><strong>Step 3:</strong> Open the <code>featured-image.php</code> file and add the following code:</p>



<pre class="wp-block-code"><code>&lt;?php
/**
 * Plugin Name: Center Featured Image
 * Description: Automatically displays and centers the current post's featured image.
 * Version: 1.0
 * Author: Maruti Kumar
 */

// Add a filter to the_content
add_filter('the_content', 'center_featured_image');

function center_featured_image($content) {
    // Check if we are inside a single post
    if (is_single()) {
        // Get the current post's ID
        $post_id = get_the_ID();

        // Get the featured image HTML
        $featured_image = get_the_post_thumbnail($post_id, 'full');

        // Check if a featured image exists
        if ($featured_image) {
            // Wrap the featured image in a container div with styling to center it
            $centered_image = '&lt;div style="text-align: center; margin-bottom: 20px;">' . $featured_image . '&lt;/div>';

            // Insert the centered featured image at the beginning of the post content
            $content = $centered_image . $content;
        }
    }

    // Return the modified content
    return $content;
}
</code></pre>



<p><strong>Step 3:</strong> Save the file and Log in to your WordPress dashboard and go to &#8220;Plugins&#8221; in the left-hand menu.</p>



<figure class="wp-block-image size-full"><img decoding="async" width="950" height="651" src="https://www.aiuniverse.xyz/wp-content/uploads/2024/01/image-51.png" alt="" class="wp-image-18456" srcset="https://www.aiuniverse.xyz/wp-content/uploads/2024/01/image-51.png 950w, https://www.aiuniverse.xyz/wp-content/uploads/2024/01/image-51-300x206.png 300w, https://www.aiuniverse.xyz/wp-content/uploads/2024/01/image-51-768x526.png 768w" sizes="(max-width: 950px) 100vw, 950px" /></figure>



<p><strong>Step 4: </strong>Find &#8220;Featured Image Plugin&#8221; in the plugins list and click on &#8220;Activate&#8221;.</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="951" height="552" src="https://www.aiuniverse.xyz/wp-content/uploads/2024/01/image-52.png" alt="" class="wp-image-18457" srcset="https://www.aiuniverse.xyz/wp-content/uploads/2024/01/image-52.png 951w, https://www.aiuniverse.xyz/wp-content/uploads/2024/01/image-52-300x174.png 300w, https://www.aiuniverse.xyz/wp-content/uploads/2024/01/image-52-768x446.png 768w" sizes="auto, (max-width: 951px) 100vw, 951px" /></figure>



<p>Now, whenever you open a post in your WordPress site, the plugin will automatically display and center the featured image at inside of the title post content.</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="525" src="https://www.aiuniverse.xyz/wp-content/uploads/2024/01/image-53-1024x525.png" alt="" class="wp-image-18458" srcset="https://www.aiuniverse.xyz/wp-content/uploads/2024/01/image-53-1024x525.png 1024w, https://www.aiuniverse.xyz/wp-content/uploads/2024/01/image-53-300x154.png 300w, https://www.aiuniverse.xyz/wp-content/uploads/2024/01/image-53-768x394.png 768w, https://www.aiuniverse.xyz/wp-content/uploads/2024/01/image-53.png 1291w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p>Thank for visiting</p>
<p>The post <a href="https://www.aiuniverse.xyz/create-a-plugin-to-always-display-and-center-the-current-posts-featured-image/">Create a plugin to always display and center the current post&#8217;s featured image</a> appeared first on <a href="https://www.aiuniverse.xyz">Artificial Intelligence</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.aiuniverse.xyz/create-a-plugin-to-always-display-and-center-the-current-posts-featured-image/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How to create a basic plugin that shows Hello World after every post or page</title>
		<link>https://www.aiuniverse.xyz/how-to-create-a-basic-plugin-that-shows-hello-world-after-every-post-or-page/</link>
					<comments>https://www.aiuniverse.xyz/how-to-create-a-basic-plugin-that-shows-hello-world-after-every-post-or-page/#respond</comments>
		
		<dc:creator><![CDATA[Maruti Kr.]]></dc:creator>
		<pubDate>Wed, 17 Jan 2024 12:45:23 +0000</pubDate>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Adding Content to Posts and Pages]]></category>
		<category><![CDATA[Custom WordPress Plugin]]></category>
		<category><![CDATA[Display Content After Post]]></category>
		<category><![CDATA[Hello World Plugin Tutorial]]></category>
		<category><![CDATA[Plugin Development Tutorial]]></category>
		<category><![CDATA[Simple WordPress Customization]]></category>
		<category><![CDATA[WordPress Filter Hook]]></category>
		<category><![CDATA[WordPress Plugin Basics]]></category>
		<category><![CDATA[WordPress Plugin Coding]]></category>
		<category><![CDATA[WordPress Plugin Development]]></category>
		<guid isPermaLink="false">https://www.aiuniverse.xyz/?p=18441</guid>

					<description><![CDATA[<p>To create a basic WordPress plugin that displays &#8220;Hello World&#8221; after every post or page, follow these steps: 2. Inside the &#8220;hello-world-plugin&#8221; folder, create a new PHP <a class="read-more-link" href="https://www.aiuniverse.xyz/how-to-create-a-basic-plugin-that-shows-hello-world-after-every-post-or-page/">Read More</a></p>
<p>The post <a href="https://www.aiuniverse.xyz/how-to-create-a-basic-plugin-that-shows-hello-world-after-every-post-or-page/">How to create a basic plugin that shows Hello World after every post or page</a> appeared first on <a href="https://www.aiuniverse.xyz">Artificial Intelligence</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>To create a basic WordPress plugin that displays &#8220;Hello World&#8221; after every post or page, follow these steps:</p>



<ol class="wp-block-list">
<li>Create a new folder titled &#8220;hello-world-plugin&#8221; in the WordPress plugins directory: <code>wp-content/plugins/</code>.</li>
</ol>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="1012" height="543" src="https://www.aiuniverse.xyz/wp-content/uploads/2024/01/image-39.png" alt="" class="wp-image-18442" srcset="https://www.aiuniverse.xyz/wp-content/uploads/2024/01/image-39.png 1012w, https://www.aiuniverse.xyz/wp-content/uploads/2024/01/image-39-300x161.png 300w, https://www.aiuniverse.xyz/wp-content/uploads/2024/01/image-39-768x412.png 768w" sizes="auto, (max-width: 1012px) 100vw, 1012px" /></figure>



<p>2. Inside the &#8220;hello-world-plugin&#8221; folder, create a new PHP file named &#8220;hello-world.php&#8221;.</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="956" height="729" src="https://www.aiuniverse.xyz/wp-content/uploads/2024/01/image-42.png" alt="" class="wp-image-18445" srcset="https://www.aiuniverse.xyz/wp-content/uploads/2024/01/image-42.png 956w, https://www.aiuniverse.xyz/wp-content/uploads/2024/01/image-42-300x229.png 300w, https://www.aiuniverse.xyz/wp-content/uploads/2024/01/image-42-768x586.png 768w" sizes="auto, (max-width: 956px) 100vw, 956px" /></figure>



<p>3. Open &#8220;hello-world.php&#8221; in a text editor and add the following code:</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="983" height="731" src="https://www.aiuniverse.xyz/wp-content/uploads/2024/01/image-43.png" alt="" class="wp-image-18446" srcset="https://www.aiuniverse.xyz/wp-content/uploads/2024/01/image-43.png 983w, https://www.aiuniverse.xyz/wp-content/uploads/2024/01/image-43-300x223.png 300w, https://www.aiuniverse.xyz/wp-content/uploads/2024/01/image-43-768x571.png 768w" sizes="auto, (max-width: 983px) 100vw, 983px" /></figure>



<p>4. Save the file.</p>



<p>5. Go to your WordPress admin dashboard, navigate to &#8220;Plugins&#8221; -> &#8220;Installed Plugins&#8221;, and you should see &#8220;Hello World Plugin&#8221; listed among the plugins.</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="976" height="593" src="https://www.aiuniverse.xyz/wp-content/uploads/2024/01/image-44.png" alt="" class="wp-image-18447" srcset="https://www.aiuniverse.xyz/wp-content/uploads/2024/01/image-44.png 976w, https://www.aiuniverse.xyz/wp-content/uploads/2024/01/image-44-300x182.png 300w, https://www.aiuniverse.xyz/wp-content/uploads/2024/01/image-44-768x467.png 768w" sizes="auto, (max-width: 976px) 100vw, 976px" /></figure>



<p>6. Activate the &#8220;Hello World Plugin&#8221;.</p>



<figure class="wp-block-image size-full is-resized"><img loading="lazy" decoding="async" src="https://www.aiuniverse.xyz/wp-content/uploads/2024/01/image-46.png" alt="" class="wp-image-18449" width="841" height="421" srcset="https://www.aiuniverse.xyz/wp-content/uploads/2024/01/image-46.png 927w, https://www.aiuniverse.xyz/wp-content/uploads/2024/01/image-46-300x150.png 300w, https://www.aiuniverse.xyz/wp-content/uploads/2024/01/image-46-768x384.png 768w" sizes="auto, (max-width: 841px) 100vw, 841px" /></figure>



<p>Now, every time you visit a post or page, you should see &#8220;Hello World!&#8221; displayed at the bottom.</p>



<p><strong><em>Note: </em></strong>Remember to adjust the plugin details (name, URI, description, author, and author URI) in the plugin header according to your preference.</p>
<p>The post <a href="https://www.aiuniverse.xyz/how-to-create-a-basic-plugin-that-shows-hello-world-after-every-post-or-page/">How to create a basic plugin that shows Hello World after every post or page</a> appeared first on <a href="https://www.aiuniverse.xyz">Artificial Intelligence</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.aiuniverse.xyz/how-to-create-a-basic-plugin-that-shows-hello-world-after-every-post-or-page/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
