1. Go to this page and download the library: Download keesiemeijer/insert-content library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
$args = array(
'insert_after_p' => 2, // Insert after the second paragraph
);
// Content you want to insert (without the parent element HTML tag)
$insert_content = 'I was inserted after the <strong>second</strong> paragraph';
echo keesiemeijer\Insert_Content\insert_content( $content, $insert_content, $args );
$args = array(
'parent_element_id' => 'specific-id'
'insert_after_p' => 2, // Insert after the second paragraph
);
// Content you want to insert (without the parent element HTML tag)
$insert_content = 'I was inserted after the <strong>second</strong> paragraph inside the targeted element';
echo keesiemeijer\Insert_Content\insert_content( $content, $insert_content, $args );
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.