Pagename: general - General
Category:Array
Post Count: 5Category:General
Pagename: general - General

WordPress – Add Custom Content Plugin

Editing posts directly within the wordpress editor can be a nuisance when wordpress inserts ‘p’ tags and the like. Sometimes I want to edit HTML in actual HTML editor which allows me greater control over the presentation of the content.

To facilitate this I have added a plugin which inserts HTML from a custom file based on the post id.

Content is added a file within the ‘custom’ folder:
“twentyfifteen-child\Custom\Content\Custom-Content-82.php

This file can be edited and viewed in a standard HTML editor. The number within the file name is the post id which can be found from url’s and other ways. When the content is shown, the content within the wordpress editor is shown first followed by the content within the file.

Here is the plugin code as to date:

<?php
/**
 * Plugin Name:       Include Custom Content
 * Plugin URI:        https://dalestake.com/2019/11/26/wordpress-add-custom-content-plugin/
 * Description:       Inserts files stored in 'Custom/Content/' into the content section (ie within the body of the post)
 * Version:           0.1
 * Author:            Dale Anderson
 * Author URI:        NA
 * License:           GPL v2 or later
 * License URI:       https://www.gnu.org/licenses/gpl-2.0.html
 * Text Domain:       include-custom-content
 */

// Check if a custom content file exists... 

add_filter('the_content', 'InsertCustomContent');
function InsertCustomContent($content)
{
    $CurID = get_the_ID();
    $FilePath = get_stylesheet_directory()."\Custom\Content\Custom-Content-".$CurID.".php";

    if(file_exists ( $FilePath))
    {
        $content = $content.file_get_contents($FilePath);
    }
    else
    {
        $content = $content;
    }
    return $content;
}

My intent is to make adjustments to allow similar files to be included such as scripts and css.

Leave a Reply

Your email address will not be published. Required fields are marked *

Category:General
Pagename: general - General

WordPress – Add Custom Content Plugin

Editing posts directly within the wordpress editor can be a nuisance when wordpress inserts ‘p’ tags and the like. Sometimes I want to edit HTML in actual HTML editor which allows me greater control over the presentation of the content.

To facilitate this I have added a plugin which inserts HTML from a custom file based on the post id.

Content is added a file within the ‘custom’ folder:
“twentyfifteen-child\Custom\Content\Custom-Content-82.php

This file can be edited and viewed in a standard HTML editor. The number within the file name is the post id which can be found from url’s and other ways. When the content is shown, the content within the wordpress editor is shown first followed by the content within the file.

Here is the plugin code as to date:

<?php
/**
 * Plugin Name:       Include Custom Content
 * Plugin URI:        https://dalestake.com/2019/11/26/wordpress-add-custom-content-plugin/
 * Description:       Inserts files stored in 'Custom/Content/' into the content section (ie within the body of the post)
 * Version:           0.1
 * Author:            Dale Anderson
 * Author URI:        NA
 * License:           GPL v2 or later
 * License URI:       https://www.gnu.org/licenses/gpl-2.0.html
 * Text Domain:       include-custom-content
 */

// Check if a custom content file exists... 

add_filter('the_content', 'InsertCustomContent');
function InsertCustomContent($content)
{
    $CurID = get_the_ID();
    $FilePath = get_stylesheet_directory()."\Custom\Content\Custom-Content-".$CurID.".php";

    if(file_exists ( $FilePath))
    {
        $content = $content.file_get_contents($FilePath);
    }
    else
    {
        $content = $content;
    }
    return $content;
}

My intent is to make adjustments to allow similar files to be included such as scripts and css.

Leave a Reply

Your email address will not be published. Required fields are marked *

Category:General
Pagename: general - General

WordPress – Useful links – Reference info

WordPress template hierarchy – How wordpress decides which template to show based on user selections. Thumbnail goes to flowchart, link goes to ‘basics’ page.
wpdb – wpdb class controls the connection and information to and from the wordpress DB (or other connected DB’s).
WP_Query – WordPress wp_query class allows manipulation of the DB query (ie change categories, authors etc)

Leave a Reply

Your email address will not be published. Required fields are marked *

Category:General
Pagename: general - General

WordPress – Useful links – Reference info

WordPress template hierarchy – How wordpress decides which template to show based on user selections. Thumbnail goes to flowchart, link goes to ‘basics’ page.
wpdb – wpdb class controls the connection and information to and from the wordpress DB (or other connected DB’s).
WP_Query – WordPress wp_query class allows manipulation of the DB query (ie change categories, authors etc)

Leave a Reply

Your email address will not be published. Required fields are marked *

Category:General
Pagename: general - General

Modelling employer/employee matching

it occurs to me that our current societal system / culture where our employees are given priority might result in associated loss due to a less efficient level of matching between skill sets and requirements.

There are a myriad of different skill sets required by various employers. If we see those requirements as random blocks forming random shapes which employees need to fit, we can model the situation in a simplistic way.

For example…Employer:

                                                                                                   
                                                                                                   
                                                                                                   
                                                                                                   

Employee:

                                                                                                   
                                                                                                   
                                                                                                   
                                                                                                   

It is like a game of tetris but with more complicated shapes….

I would summize that prioritising one side over the other could result in lost efficiency which in the model above would be represented by poorer matches.

By taking the best ‘fits’, one at a time, the best ‘overall’ match would be compromised.

Leave a Reply

Your email address will not be published. Required fields are marked *