An open API service indexing awesome lists of open source software.

https://github.com/creative-workflow/lib-wordpress

Many helper for wordpress theme development.
https://github.com/creative-workflow/lib-wordpress

Last synced: 8 months ago
JSON representation

Many helper for wordpress theme development.

Awesome Lists containing this project

README

          

# creative-workflow/lib-wordpress

### Setup
```
bower install --save creative-workflow.sass
bower install --save creative-workflow.php
bower install --save creative-workflow.wordpress

or

composer require creative-workflow/sass
composer require creative-workflow/php
composer require creative-workflow/wordpress

or

git submodule add https://github.com/creative-workflow/lib-wordpress.git ./wordpress/wp-content/themes/child/lib/cw/wp
git submodule add https://github.com/creative-workflow/lib-php.git ./wordpress/wp-content/themes/child/lib/cw/php
git submodule add https://github.com/creative-workflow/lib-sass.git ./wordpress/wp-content/themes/child/lib/cw/sass
```

### functions.php
```php
adminBarName('Page-Options')
->typeText('global_footer_post_id',
'ID des Footer-Posts (Divi-Bibliothek)')

->typePlain('color_info',
'Farbinfo',
'



hex: #72ac4d

rgb: rgba(114, 172, 77, 1)
');

```

##### 04_assets.php
```php
scripts()
->add('main-js', 'js/main.js', ['jquery'], 1, true)
->inline('main-js', $wpOptions->toJs())
->jqReady(
$jQuery->getScript(
$wpAssets->expand('js/app/loader.js')
)
)
->replaceJquery('//ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js')
->removeEmojiScript()
->remove(
'google-maps-api',
'divi-fitvids',
'waypoints',
'magnific-popup',
'hashchange',
'salvattore',
'easypiechart',
'magnific-popup',
'wp-embed'
);

$wpAssets->styles()
->addParent()
->addAdmin('eve-admin-css', 'admin.css')
->conditional(function($wpAssests){
if(!current_user_can( 'update_core' )) // no admin
$wpAssests->remove('dashicons');
});

$wpAssets->theme()
->touchAfterPostUpdated() // can be used for browser-sync reload
->addFooterContentJs($jQuery); // when will render onReady content when __toString is called

```

##### 06_menu.php
```php
addMenu('footer-1-menu')
->addMenu('footer-2-menu')
->addMenu('footer-3-menu');
```

##### 07_custom_post_types.php
```php
typePage()
->isPublic()
->slug('jobs')
->hasArchive(false)
->isHierarchical(false)
->isPubliclyQueryable()
->showInUi()
->showInMenu()
->supportsTitle()
->supportsEditor()
->supportsThumbnail()
->supportsRevisions()
->supportsPageAttributes()
->supportsPostFormats()
->menuPositionBelowPosts()
->name('Job-Board')
->singularName('Stellenanzeige')
->menuName('Job-Board')
->labelAddNew('Anzeige erstellen')
->adminBarName('Job-Board')
->addMetaBox(
(new \cw\wp\custom\MetaBox('task'))
->title('Aufgaben')
->typeHtml()
)
->publish();

$taxanomy = new \cw\wp\custom\Taxanomy('job_place');
$taxanomy->setObjectType($postType)
->isHierarchical(false)
->showInUi()
->showAdminColumn()
->queryVar(true)
->slug('place')
->name('Standorte')
->publish();

$taxanomy = new \cw\wp\custom\Taxanomy('job_category');
$taxanomy->setObjectType($postType)
->isHierarchical(false)
->showInUi()
->showAdminColumn()
->queryVar(true)
->slug('category')
->name('Kategorien')
->publish();

$taxanomy = new \cw\wp\custom\Taxanomy('job_position');
$taxanomy->setObjectType($postType)
->isHierarchical(false)
->showInUi()
->showAdminColumn()
->queryVar(true)
->slug('position')
->name('Positionen')
->publish();
```

##### hallo-world/css/module.sass
```sass
@import "variables"

@import "mixins/css/css3"
@import "mixins/css/positioning"
@import "mixins/helper/helper"

@import "mixins/grid/mediaqueries"
@import "mixins/grid/grid"

@import "mixins/wordpress/divi"
@import "mixins/wordpress/post"

+custom-divi-module('cw-module-hallo-world')
.image
display: none
+min-width-sm
+block
+absolute
right: -40px
bottom: 0

.content-wrapper
[...]
```