How to Create Host Name on Ubuntu?

Open your termina:

ctrl+alt+t

Edit your host file

#sudo nano /etc/hosts

Set your Host Name:

127.0.0.1 HostName

Save the file:

ctrl+o

Enter

ctrl+x

Now you can set your host name as domain on Ampps by adding new domain.

How to Get Back Sublime Text 3 Menu

Sometimes we hide sublime text editor’s top menu. But there is no graphical option get back the menu. The task you have to do to get the menu is –

Ctrl + Shift + P

Then type–

VM or vman

you will see:

View: Toggle Menu

Select it and press enter.

Finish!

How to show image from CodeStar Metabox

The non-repeatable image field creation:

[php]
$options[] = array(
‘id’ => ‘_custom_category_options’,
‘post_type’ => ‘category’, // or array( ‘category’, ‘post_tag’ )
‘context’ => ‘normal’,
‘priority’ => ‘default’,
‘sections’ => array(
// begin: a section
array(
‘name’ => ‘section_1’,
‘title’ => ‘Section 1’,
‘icon’ => ‘fa fa-cog’,

// begin: fields
‘fields’ => array(

// a field
array(
‘id’ => ‘sponsors_image’,
‘type’ => ‘image’,
‘title’ => ‘Clients Logo’,
),

), // end: fields
), // end: a section

),
);
[/php]
02. Calling the image on front-end:
[php]

  • How to create image gallery with CodeStar Metabox?

    1.Creating Gallery field:

    // a field
    array(
       'id'          => 'gallery_2',
       'type'        => 'gallery',
       'title'       => 'Logos of the happy clients',
       'add_title'   => 'Add Images',
       'edit_title'  => 'Edit Images',
       'clear_title' => 'Remove Images',
    ),

    Read More “How to create image gallery with CodeStar Metabox?”

  • How to Use Theme on Sublime Text 3

    We’ll see how we can use a theme on Sublime Text 3. Here I’ll install Material Theme as I like so much. Let’s see –
    Press the button to open Package Control:

    Ctrl + Shift + p

    Type “Install Package” and Select it.
    Now, Type “Material Theme” and Select in to install.

    Activate the theme with the following codes at Preference( Preference-> Setting-User) –

    "theme": "Material-Theme.sublime-theme",
    "color_scheme": "Packages/Material Theme/schemes/Material-Theme.tmTheme",
    

    After installation of the theme. To customize take look in https://github.com/equinusocio/material-theme

    How to call jQuery in WordPress Plugin

     

    define( 'AITASI_URL', plugin_dir_url( __FILE__ ) );
     
    add_action( 'wp_enqueue_scripts', 'aitasi_script_load' );
    if ( ! function_exists( 'aitasi_script_load' ) ) {
        function aitasi_script_load() {
            wp_enqueue_script( 'backstretch-script', AITASI_URL . '/js/jquery.backstretch.min.js', array( 'jquery' ), '1.0',
            true);
        }
    }

    How to Fix – The plugin generated xxx characters of unexpected output during activation?

    After activation plugin, it shows– The plugin generated 362 characters of unexpected output during activation. If you notice “headers already sent” messages, problems with syndication feeds or other issues, try deactivating or removing this plugin.

    Let’s see to find the error.

    01. creates log file error_activation.txt in your plugin folder.
    02. Add this code to your plugin main file –

    [php]
    add_action(‘activated_plugin’,’my_save_error’);
    function my_save_error()
    {
    file_put_contents(dirname(__file__).’/error_activation.txt’, ob_get_contents());
    }
    [/php]

    03. Activate the plugin and see the error in the text file.

    Implement of Codestar Sorter Field

    Include the code the code in the config file–

    [php]
    // Sorter
    array(
    ‘id’ => ‘aitasi_sorted_section’,
    ‘type’ => ‘sorter’,
    ‘title’ => ‘Section Sorter’,
    ‘default’ => array(
    ‘enabled’ => array(
    ‘home’ => ‘Home’,
    ‘service’ => ‘Service ‘,
    ‘aboutus’ => ‘About Us’,
    ‘contact’ => ‘Contact’,
    ‘footer’ => ‘Footer’,
    ),
    ),
    ‘enabled_title’ => ‘Active Sections’,
    ‘disabled_title’ => ‘Deactive Sections’,
    ),

    [/php]
    Read More “Implement of Codestar Sorter Field”

    Full-width Vimeo Background Video

    Here we’ll see how we can set a Vimeo video background. The markup should be –

    [php]


    [/php]
    The CSS is –[php]
    .vimeo-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
    }
    .vimeo-wrapper iframe {
    width: 100vw;
    height: 56.25vw; /* Given a 16:9 aspect ratio, 9/16*100 = 56.25 */
    min-height: 100vh;
    min-width: 177.77vh; /* Given a 16:9 aspect ratio, 16/9*100 = 177.77 */
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    }
    [/php]njoy it.Credit goes to Christophe Marois