Need Advice? CALL: +61 417949565

Riksi - web design and development

  • Home
  • ABOUT US
  • OUR WORK
  • BLOG
  • CONTACT US
  • Home
  • BLOG
  • General
  • WordPress with composer

WordPress with composer

WordPress with composer

composer/installers is for PHP package authors to require in their composer.json. It will install their package to the correct location based on the specified package type.

website:

https://packagist.org/packages/composer/installers

Example of the composer.json file in the template folder

add the following code to the root of the template folder with the correct name and update the type to whatever is easier for you

1
2
3
4
5
6
7
8
9
10
11
 
 
{
    "name": "riksi_wordpress_theme",
    "type": "</code>wp-theme<code>",
    "require": {
        "composer/installers": "~1.0"
    }
}
 
 

Using the installer in the project

In the main composer file on the project, you need to add the following details:

please note, the following code, allow you to download the code from GitLab repo with the correct version and add it to the correct path on the site

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
 
 
{
"name": "name of the package",
"repositories": [
        {
            "type": "gitlab",
            "url": "[email protected]:package/name.git"
        },
    ],
"require": {
        "composer/installers": "~1.0.0",
        "package/name": "1.0.0" //version of the package
    },
"config": {
        "gitlab-oauth": {
            "gitlab.com": "the_auth_key"
        }
    },
    "extra": {
        "installer-paths": {
            "your/custom/path/{$name}/": ["type:wordpress-plugin"]
        }
    }
}
 
 

and finally, run the composer install and check the path

Tagged under: composer, package
Nick
Saturday, 09 February 2019 / Published in General, PHP, Wordpress

What you can read next

Show WordPress Page Content in Another Post Template
Create & Use Dynamic Sidebar in WordPress
Using WordPress Functionality outside wp

Leave a Reply Cancel reply

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

Archive

  • General
    • Smart Home
  • Web developing
    • command line
    • CSS
    • General
    • git
    • Javascript
    • Laravel
    • Magento
    • MySQL
    • PHP
    • Security
    • Shopify
    • Wordpress

Recent Posts

  • Install HomeAssistant on Raspberry pi

  • Shopify ERR_INVALID_ARG_TYPE Error

Riksi

Riksi is a creative, professional & cutting-edge custom web design and development company.

HERE TO HELP

  • BLOG
  • Contact Us
  • Our Work
  • About Us

New on Blog

  • Install HomeAssistant on Raspberry pi

    To install it, We need to connect the SD card t...
  • Shopify ERR_INVALID_ARG_TYPE Error

    fix the Internal Server Error occurred while in...

GET IN TOUCH

T: (+61) 417 949 565
Email: [email protected]

Contact Us
Fill out the form and our team will be in touch with you promptly. Thank you for your interest!

AU & NZ
T: (+613) 9014 9495
T: (+61) 417 949 565
Email: [email protected]


US & Canada
Email: [email protected]

NAME

EMAIL

PROJECT TYPE
PROJECT BUDGET

MESSAGE

over a year agoAdd Password Protection to any Folder with .htaccess file https://t.co/88Gh1B8DDt
over a year ago@Telstra is that u: Hi from Telstra, we will be calling shortly to confirm we have correct details on Telstra acc. Any q call 1800139870,
Follow @riksi_web

Whats on Instagram

Loading...

Tags

.htaccess calculation cherry pick composer content css deployer documentation error flex general knowledge get started git git stash hack javascript log mysql package password php PHP Trick replace scss shopify sidebar ssh symlink sync trick ubuntu windows 10 wordpress trick wp
  • GET SOCIAL
Riksi - web design and development

© 2020 All rights reserved. Riksi.com.

TOP