first commit

This commit is contained in:
Ryan Ariana
2024-05-06 11:04:37 +07:00
commit aee061ddba
7322 changed files with 2918816 additions and 0 deletions

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="23" height="24" fill="none" xmlns:v="https://vecta.io/nano"><path d="M11.5.45a11.26 11.26 0 0 0-5.796 1.564 11.64 11.64 0 0 0-4.14 4.14A11.26 11.26 0 0 0 0 11.95a11.26 11.26 0 0 0 1.564 5.796 11.64 11.64 0 0 0 4.14 4.14c1.779 1.043 3.711 1.564 5.796 1.564s4.017-.521 5.796-1.564a11.64 11.64 0 0 0 4.14-4.14C22.479 15.967 23 14.035 23 11.95s-.521-4.017-1.564-5.796a11.64 11.64 0 0 0-4.14-4.14A11.26 11.26 0 0 0 11.5.45zM8.625 16.734H6.716V7.166h1.909v9.568zm7.659 0h-5.75v-1.909h5.75v1.909zm0-3.818h-5.75v-1.932h5.75v1.932zm0-3.841h-5.75V7.166h5.75v1.909z" fill="#93003f"/></svg>

After

Width:  |  Height:  |  Size: 625 B

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 6.8 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 31 KiB

View File

@@ -0,0 +1 @@
<?php return array('dependencies' => array('react', 'wp-api', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n', 'wp-notices'), 'version' => '8cbb1cf5cd11d04d2b7a');

View File

@@ -0,0 +1 @@
#hello-elementor-settings .components-placeholder{background:#f1f1f1}#hello-elementor-settings .hello_elementor__header{background-color:#fff;box-shadow:0 1px 0 hsla(0,0%,84%,.5),0 1px 2px #eee;margin-inline-start:-2em;padding:20px 10px}#hello-elementor-settings .hello_elementor__header .hello_elementor__container{margin:0 auto;max-width:750px}#hello-elementor-settings .hello_elementor__header .hello_elementor__container .hello_elementor__title{align-items:center;display:flex;justify-content:center}#hello-elementor-settings .hello_elementor__header .hello_elementor__container .hello_elementor__title .dashicon{color:#757575}#hello-elementor-settings .hello_elementor__main{margin-inline-end:auto;margin-inline-start:auto;max-width:750px}#hello-elementor-settings .hello_elementor__main .components-panel{background:none;border:none}#hello-elementor-settings .hello_elementor__main .components-panel__body{background:#fff;border:1px solid #e2e4e7;margin:1rem 0}#hello-elementor-settings .hello_elementor__main .components-notice{margin:0;margin-block-end:20px}#hello-elementor-settings .hello_elementor__main .components-notice .dashicon{color:#f0b849;padding-inline-end:10px}#hello-elementor-settings .hello_elementor__main .components-notice button{display:none}#hello-elementor-settings .hello_elementor__main .code-example{border-radius:4px;display:inline-block;font-size:10px;margin-block-end:.25rem}#hello-elementor-settings .hello_elementor__main .code-example+:not(.code-example){margin-block-start:1.25rem}#hello-elementor-settings .components-base-control__help{margin-block-start:.5rem}#hello-elementor-settings .hello_elementor__notices .components-snackbar{bottom:.5rem;position:fixed}#hello-elementor-settings .hello_elementor__action_links{margin-block-end:20px;margin-block-start:50px;text-align:center}#hello-elementor-settings .hello_elementor__action_links__title{font-weight:700}#hello-elementor-settings .hello_elementor__action_links__message{font-weight:400}

View File

@@ -0,0 +1,428 @@
/******/ (() => { // webpackBootstrap
/******/ var __webpack_modules__ = ({
/***/ 222:
/***/ ((__unused_webpack_module, exports) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports.ActionLinks = void 0;
const ActionLinks = ({
image,
alt,
title,
message,
button,
link
}) => {
return /*#__PURE__*/React.createElement("div", {
className: "hello_elementor__action_links"
}, /*#__PURE__*/React.createElement("img", {
src: image,
alt: alt
}), /*#__PURE__*/React.createElement("p", {
className: "hello_elementor__action_links__title"
}, title), /*#__PURE__*/React.createElement("p", {
className: "hello_elementor__action_links__message"
}, message), /*#__PURE__*/React.createElement("a", {
className: "components-button is-secondary",
href: link,
target: "_blank",
rel: "noreferrer"
}, button));
};
exports.ActionLinks = ActionLinks;
/***/ }),
/***/ 3:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
"use strict";
var _interopRequireDefault = __webpack_require__(836);
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports.SettingsPage = void 0;
var _react = __webpack_require__(196);
var _notices = __webpack_require__(961);
var _data = __webpack_require__(818);
var _i18n = __webpack_require__(736);
var _api = _interopRequireDefault(__webpack_require__(101));
var _components = __webpack_require__(609);
var _settingsPanel = __webpack_require__(230);
var _actionLinksPanel = __webpack_require__(995);
const Notices = () => {
const notices = (0, _data.useSelect)(select => select(_notices.store).getNotices().filter(notice => 'snackbar' === notice.type), []);
const {
removeNotice
} = (0, _data.useDispatch)(_notices.store);
return /*#__PURE__*/React.createElement(_components.SnackbarList, {
className: "edit-site-notices",
notices: notices,
onRemove: removeNotice
});
};
const SETTINGS = {
DESCRIPTION_META_TAG: '_description_meta_tag',
SKIP_LINK: '_skip_link',
HEADER_FOOTER: '_header_footer',
PAGE_TITLE: '_page_title',
HELLO_STYLE: '_hello_style',
HELLO_THEME: '_hello_theme'
};
const SettingsPage = () => {
const [hasLoaded, setHasLoaded] = (0, _react.useState)(false);
const [settingsData, setSettingsData] = (0, _react.useState)({});
const settingsPrefix = 'hello_elementor_settings';
/**
* Update settings data.
*
* @param {string} settingsName
* @param {string} settingsValue
*/
const updateSettings = (settingsName, settingsValue) => {
setSettingsData({
...settingsData,
[settingsName]: settingsValue
});
};
/**
* Save settings to server.
*/
const saveSettings = () => {
const data = {};
Object.values(SETTINGS).forEach(value => data[`${settingsPrefix}${value}`] = settingsData[value] ? 'true' : '');
const settings = new _api.default.models.Settings(data);
settings.save();
(0, _data.dispatch)('core/notices').createNotice('success', (0, _i18n.__)('Settings Saved', 'hello-elementor'), {
type: 'snackbar',
isDismissible: true
});
};
(0, _react.useEffect)(() => {
const fetchSettings = async () => {
try {
await _api.default.loadPromise;
const settings = new _api.default.models.Settings();
const response = await settings.fetch();
const data = {};
Object.values(SETTINGS).forEach(value => data[value] = response[`${settingsPrefix}${value}`]);
setSettingsData(data);
setHasLoaded(true);
} catch (error) {
// eslint-disable-next-line no-console
console.error(error);
}
};
if (hasLoaded) {
return;
}
fetchSettings();
}, [settingsData]);
if (!hasLoaded) {
return /*#__PURE__*/React.createElement(_components.Placeholder, null, /*#__PURE__*/React.createElement(_components.Spinner, null));
}
return /*#__PURE__*/React.createElement(_react.Fragment, null, /*#__PURE__*/React.createElement("div", {
className: "hello_elementor__header"
}, /*#__PURE__*/React.createElement("div", {
className: "hello_elementor__container"
}, /*#__PURE__*/React.createElement("div", {
className: "hello_elementor__title"
}, /*#__PURE__*/React.createElement("h1", null, (0, _i18n.__)('Hello Theme Settings', 'hello-elementor'))))), /*#__PURE__*/React.createElement("div", {
className: "hello_elementor__main"
}, /*#__PURE__*/React.createElement(_components.Panel, null, /*#__PURE__*/React.createElement(_settingsPanel.SettingsPanel, {
SETTINGS,
settingsData,
updateSettings
}), /*#__PURE__*/React.createElement(_components.Button, {
isPrimary: true,
onClick: saveSettings
}, (0, _i18n.__)('Save Settings', 'hello-elementor'))), /*#__PURE__*/React.createElement(_actionLinksPanel.ActionLinksPanel, null)), /*#__PURE__*/React.createElement("div", {
className: "hello_elementor__notices"
}, /*#__PURE__*/React.createElement(Notices, null)));
};
exports.SettingsPage = SettingsPage;
/***/ }),
/***/ 995:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports.ActionLinksPanel = void 0;
var _i18n = __webpack_require__(736);
var _actionLinks = __webpack_require__(222);
const actionLinks = {
'install-elementor': {
image: helloAdminData.templateDirectoryURI + '/assets/images/elementor.svg',
alt: (0, _i18n.__)('Elementor', 'hello-elementor'),
title: (0, _i18n.__)('Install Elementor', 'hello-elementor'),
message: (0, _i18n.__)('Create cross-site header & footer using Elementor.', 'hello-elementor'),
button: (0, _i18n.__)('Install Elementor', 'hello-elementor'),
link: helloAdminData.actionLinkURL
},
'activate-elementor': {
image: helloAdminData.templateDirectoryURI + '/assets/images/elementor.svg',
alt: (0, _i18n.__)('Elementor', 'hello-elementor'),
title: (0, _i18n.__)('Activate Elementor', 'hello-elementor'),
message: (0, _i18n.__)('Create cross-site header & footer using Elementor.', 'hello-elementor'),
button: (0, _i18n.__)('Activate Elementor', 'hello-elementor'),
link: helloAdminData.actionLinkURL
},
'activate-header-footer-experiment': {
image: helloAdminData.templateDirectoryURI + '/assets/images/elementor.svg',
alt: (0, _i18n.__)('Elementor', 'hello-elementor'),
title: (0, _i18n.__)('Style using Elementor', 'hello-elementor'),
message: (0, _i18n.__)('Design your cross-site header & footer from Elementors "Site Settings" panel.', 'hello-elementor'),
button: (0, _i18n.__)('Activate header & footer experiment', 'hello-elementor'),
link: helloAdminData.actionLinkURL
},
'style-header-footer': {
image: helloAdminData.templateDirectoryURI + '/assets/images/elementor.svg',
alt: (0, _i18n.__)('Elementor', 'hello-elementor'),
title: (0, _i18n.__)('Style cross-site header & footer', 'hello-elementor'),
message: (0, _i18n.__)('Customize your cross-site header & footer from Elementors "Site Settings" panel.', 'hello-elementor'),
button: (0, _i18n.__)('Start Designing', 'hello-elementor'),
link: helloAdminData.actionLinkURL
}
};
const ActionLinksPanel = () => {
if (!helloAdminData.actionLinkType) {
return;
}
return /*#__PURE__*/React.createElement(_actionLinks.ActionLinks, actionLinks[helloAdminData.actionLinkType]);
};
exports.ActionLinksPanel = ActionLinksPanel;
/***/ }),
/***/ 230:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports.SettingsPanel = void 0;
var _i18n = __webpack_require__(736);
var _components = __webpack_require__(609);
const SettingsPanel = ({
SETTINGS,
settingsData,
updateSettings
}) => {
const protocol = window.location.protocol || 'https:';
const hostname = window.location.hostname || 'example.com';
const prefix = protocol + '//' + hostname;
return /*#__PURE__*/React.createElement(_components.PanelBody, {
title: (0, _i18n.__)('Hello Theme Settings', 'hello-elementor')
}, /*#__PURE__*/React.createElement(_components.Notice, {
status: "warning",
isDismissible: "false"
}, /*#__PURE__*/React.createElement(_components.Dashicon, {
icon: "flag"
}), (0, _i18n.__)('Be cautious, disabling some of the following options may break your website.', 'hello-elementor')), /*#__PURE__*/React.createElement(_components.ToggleControl, {
label: (0, _i18n.__)('Disable description meta tag', 'hello-elementor'),
help: (0, _i18n.__)('Remove the description meta tag in singular content pages that contain an excerpt.', 'hello-elementor'),
checked: !!settingsData[SETTINGS.DESCRIPTION_META_TAG] || false,
onChange: value => updateSettings(SETTINGS.DESCRIPTION_META_TAG, value)
}), /*#__PURE__*/React.createElement("code", {
className: "code-example"
}, " <meta name=\"description\" content=\"...\" /> "), /*#__PURE__*/React.createElement(_components.ToggleControl, {
label: (0, _i18n.__)('Disable skip link', 'hello-elementor'),
help: (0, _i18n.__)('Remove the "Skip to content" link used by screen-readers and users navigating with a keyboard.', 'hello-elementor'),
checked: !!settingsData[SETTINGS.SKIP_LINK] || false,
onChange: value => updateSettings(SETTINGS.SKIP_LINK, value)
}), /*#__PURE__*/React.createElement("code", {
className: "code-example"
}, " <a class=\"skip-link screen-reader-text\" href=\"#content\"> Skip to content </a> "), /*#__PURE__*/React.createElement(_components.ToggleControl, {
label: (0, _i18n.__)('Disable cross-site header & footer', 'hello-elementor'),
help: (0, _i18n.__)('Remove the header & footer sections from all pages, and their CSS/JS files.', 'hello-elementor'),
checked: !!settingsData[SETTINGS.HEADER_FOOTER] || false,
onChange: value => updateSettings(SETTINGS.HEADER_FOOTER, value)
}), /*#__PURE__*/React.createElement("code", {
className: "code-example"
}, " <header id=\"site-header\" class=\"site-header\"> ... </header> "), /*#__PURE__*/React.createElement("code", {
className: "code-example"
}, " <footer id=\"site-footer\" class=\"site-footer\"> ... </footer> "), /*#__PURE__*/React.createElement(_components.ToggleControl, {
label: (0, _i18n.__)('Disable page title', 'hello-elementor'),
help: (0, _i18n.__)('Remove the section above the content that contains the main heading of the page.', 'hello-elementor'),
checked: !!settingsData[SETTINGS.PAGE_TITLE] || false,
onChange: value => updateSettings(SETTINGS.PAGE_TITLE, value)
}), /*#__PURE__*/React.createElement("code", {
className: "code-example"
}, " <header class=\"page-header\"> <h1 class=\"entry-title\"> Post title </h1> </header> "), /*#__PURE__*/React.createElement(_components.ToggleControl, {
label: (0, _i18n.__)('Unregister Hello style.css', 'hello-elementor'),
help: (0, _i18n.__)("Disable Hello theme's style.css file which contains CSS reset rules for unified cross-browser view.", 'hello-elementor'),
checked: !!settingsData[SETTINGS.HELLO_STYLE] || false,
onChange: value => updateSettings(SETTINGS.HELLO_STYLE, value)
}), /*#__PURE__*/React.createElement("code", {
className: "code-example"
}, " <link rel=\"stylesheet\" href=\"", prefix, "/wp-content/themes/hello-elementor/style.min.css\" /> "), /*#__PURE__*/React.createElement(_components.ToggleControl, {
label: (0, _i18n.__)('Unregister Hello theme.css', 'hello-elementor'),
help: (0, _i18n.__)("Disable Hello theme's theme.css file which contains CSS rules that style WordPress elements.", 'hello-elementor'),
checked: !!settingsData[SETTINGS.HELLO_THEME] || false,
onChange: value => updateSettings(SETTINGS.HELLO_THEME, value)
}), /*#__PURE__*/React.createElement("code", {
className: "code-example"
}, " <link rel=\"stylesheet\" href=\"", prefix, "/wp-content/themes/hello-elementor/theme.min.css\" /> "));
};
exports.SettingsPanel = SettingsPanel;
/***/ }),
/***/ 100:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
// extracted by mini-css-extract-plugin
/***/ }),
/***/ 196:
/***/ ((module) => {
"use strict";
module.exports = window["React"];
/***/ }),
/***/ 101:
/***/ ((module) => {
"use strict";
module.exports = window["wp"]["api"];
/***/ }),
/***/ 609:
/***/ ((module) => {
"use strict";
module.exports = window["wp"]["components"];
/***/ }),
/***/ 818:
/***/ ((module) => {
"use strict";
module.exports = window["wp"]["data"];
/***/ }),
/***/ 307:
/***/ ((module) => {
"use strict";
module.exports = window["wp"]["element"];
/***/ }),
/***/ 736:
/***/ ((module) => {
"use strict";
module.exports = window["wp"]["i18n"];
/***/ }),
/***/ 961:
/***/ ((module) => {
"use strict";
module.exports = window["wp"]["notices"];
/***/ }),
/***/ 836:
/***/ ((module) => {
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
"default": obj
};
}
module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports;
/***/ })
/******/ });
/************************************************************************/
/******/ // The module cache
/******/ var __webpack_module_cache__ = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ var cachedModule = __webpack_module_cache__[moduleId];
/******/ if (cachedModule !== undefined) {
/******/ return cachedModule.exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = __webpack_module_cache__[moduleId] = {
/******/ // no module.id needed
/******/ // no module.loaded needed
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/************************************************************************/
/******/ /* webpack/runtime/make namespace object */
/******/ (() => {
/******/ // define __esModule on exports
/******/ __webpack_require__.r = (exports) => {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/ })();
/******/
/************************************************************************/
var __webpack_exports__ = {};
// This entry need to be wrapped in an IIFE because it need to be in strict mode.
(() => {
"use strict";
__webpack_require__(100);
var _element = __webpack_require__(307);
var _settingsPage = __webpack_require__(3);
const App = () => {
return /*#__PURE__*/React.createElement(_settingsPage.SettingsPage, null);
};
document.addEventListener('DOMContentLoaded', () => {
const rootElement = document.getElementById('hello-elementor-settings');
if (rootElement) {
(0, _element.render)( /*#__PURE__*/React.createElement(App, null), rootElement);
}
});
})();
/******/ })()
;

View File

@@ -0,0 +1 @@
#hello-elementor-settings .components-placeholder{background:#f1f1f1}#hello-elementor-settings .hello_elementor__header{background-color:#fff;box-shadow:0 1px 0 hsla(0,0%,84%,.5),0 1px 2px #eee;margin-inline-start:-2em;padding:20px 10px}#hello-elementor-settings .hello_elementor__header .hello_elementor__container{margin:0 auto;max-width:750px}#hello-elementor-settings .hello_elementor__header .hello_elementor__container .hello_elementor__title{align-items:center;display:flex;justify-content:center}#hello-elementor-settings .hello_elementor__header .hello_elementor__container .hello_elementor__title .dashicon{color:#757575}#hello-elementor-settings .hello_elementor__main{margin-inline-end:auto;margin-inline-start:auto;max-width:750px}#hello-elementor-settings .hello_elementor__main .components-panel{background:none;border:none}#hello-elementor-settings .hello_elementor__main .components-panel__body{background:#fff;border:1px solid #e2e4e7;margin:1rem 0}#hello-elementor-settings .hello_elementor__main .components-notice{margin:0;margin-block-end:20px}#hello-elementor-settings .hello_elementor__main .components-notice .dashicon{color:#f0b849;padding-inline-end:10px}#hello-elementor-settings .hello_elementor__main .components-notice button{display:none}#hello-elementor-settings .hello_elementor__main .code-example{border-radius:4px;display:inline-block;font-size:10px;margin-block-end:.25rem}#hello-elementor-settings .hello_elementor__main .code-example+:not(.code-example){margin-block-start:1.25rem}#hello-elementor-settings .components-base-control__help{margin-block-start:.5rem}#hello-elementor-settings .hello_elementor__notices .components-snackbar{bottom:.5rem;position:fixed}#hello-elementor-settings .hello_elementor__action_links{margin-block-end:20px;margin-block-start:50px;text-align:center}#hello-elementor-settings .hello_elementor__action_links__title{font-weight:700}#hello-elementor-settings .hello_elementor__action_links__message{font-weight:400}

View File

@@ -0,0 +1,428 @@
/******/ (() => { // webpackBootstrap
/******/ var __webpack_modules__ = ({
/***/ 222:
/***/ ((__unused_webpack_module, exports) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports.ActionLinks = void 0;
const ActionLinks = ({
image,
alt,
title,
message,
button,
link
}) => {
return /*#__PURE__*/React.createElement("div", {
className: "hello_elementor__action_links"
}, /*#__PURE__*/React.createElement("img", {
src: image,
alt: alt
}), /*#__PURE__*/React.createElement("p", {
className: "hello_elementor__action_links__title"
}, title), /*#__PURE__*/React.createElement("p", {
className: "hello_elementor__action_links__message"
}, message), /*#__PURE__*/React.createElement("a", {
className: "components-button is-secondary",
href: link,
target: "_blank",
rel: "noreferrer"
}, button));
};
exports.ActionLinks = ActionLinks;
/***/ }),
/***/ 3:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
"use strict";
var _interopRequireDefault = __webpack_require__(836);
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports.SettingsPage = void 0;
var _react = __webpack_require__(196);
var _notices = __webpack_require__(961);
var _data = __webpack_require__(818);
var _i18n = __webpack_require__(736);
var _api = _interopRequireDefault(__webpack_require__(101));
var _components = __webpack_require__(609);
var _settingsPanel = __webpack_require__(230);
var _actionLinksPanel = __webpack_require__(995);
const Notices = () => {
const notices = (0, _data.useSelect)(select => select(_notices.store).getNotices().filter(notice => 'snackbar' === notice.type), []);
const {
removeNotice
} = (0, _data.useDispatch)(_notices.store);
return /*#__PURE__*/React.createElement(_components.SnackbarList, {
className: "edit-site-notices",
notices: notices,
onRemove: removeNotice
});
};
const SETTINGS = {
DESCRIPTION_META_TAG: '_description_meta_tag',
SKIP_LINK: '_skip_link',
HEADER_FOOTER: '_header_footer',
PAGE_TITLE: '_page_title',
HELLO_STYLE: '_hello_style',
HELLO_THEME: '_hello_theme'
};
const SettingsPage = () => {
const [hasLoaded, setHasLoaded] = (0, _react.useState)(false);
const [settingsData, setSettingsData] = (0, _react.useState)({});
const settingsPrefix = 'hello_elementor_settings';
/**
* Update settings data.
*
* @param {string} settingsName
* @param {string} settingsValue
*/
const updateSettings = (settingsName, settingsValue) => {
setSettingsData({
...settingsData,
[settingsName]: settingsValue
});
};
/**
* Save settings to server.
*/
const saveSettings = () => {
const data = {};
Object.values(SETTINGS).forEach(value => data[`${settingsPrefix}${value}`] = settingsData[value] ? 'true' : '');
const settings = new _api.default.models.Settings(data);
settings.save();
(0, _data.dispatch)('core/notices').createNotice('success', (0, _i18n.__)('Settings Saved', 'hello-elementor'), {
type: 'snackbar',
isDismissible: true
});
};
(0, _react.useEffect)(() => {
const fetchSettings = async () => {
try {
await _api.default.loadPromise;
const settings = new _api.default.models.Settings();
const response = await settings.fetch();
const data = {};
Object.values(SETTINGS).forEach(value => data[value] = response[`${settingsPrefix}${value}`]);
setSettingsData(data);
setHasLoaded(true);
} catch (error) {
// eslint-disable-next-line no-console
console.error(error);
}
};
if (hasLoaded) {
return;
}
fetchSettings();
}, [settingsData]);
if (!hasLoaded) {
return /*#__PURE__*/React.createElement(_components.Placeholder, null, /*#__PURE__*/React.createElement(_components.Spinner, null));
}
return /*#__PURE__*/React.createElement(_react.Fragment, null, /*#__PURE__*/React.createElement("div", {
className: "hello_elementor__header"
}, /*#__PURE__*/React.createElement("div", {
className: "hello_elementor__container"
}, /*#__PURE__*/React.createElement("div", {
className: "hello_elementor__title"
}, /*#__PURE__*/React.createElement("h1", null, (0, _i18n.__)('Hello Theme Settings', 'hello-elementor'))))), /*#__PURE__*/React.createElement("div", {
className: "hello_elementor__main"
}, /*#__PURE__*/React.createElement(_components.Panel, null, /*#__PURE__*/React.createElement(_settingsPanel.SettingsPanel, {
SETTINGS,
settingsData,
updateSettings
}), /*#__PURE__*/React.createElement(_components.Button, {
isPrimary: true,
onClick: saveSettings
}, (0, _i18n.__)('Save Settings', 'hello-elementor'))), /*#__PURE__*/React.createElement(_actionLinksPanel.ActionLinksPanel, null)), /*#__PURE__*/React.createElement("div", {
className: "hello_elementor__notices"
}, /*#__PURE__*/React.createElement(Notices, null)));
};
exports.SettingsPage = SettingsPage;
/***/ }),
/***/ 995:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports.ActionLinksPanel = void 0;
var _i18n = __webpack_require__(736);
var _actionLinks = __webpack_require__(222);
const actionLinks = {
'install-elementor': {
image: helloAdminData.templateDirectoryURI + '/assets/images/elementor.svg',
alt: (0, _i18n.__)('Elementor', 'hello-elementor'),
title: (0, _i18n.__)('Install Elementor', 'hello-elementor'),
message: (0, _i18n.__)('Create cross-site header & footer using Elementor.', 'hello-elementor'),
button: (0, _i18n.__)('Install Elementor', 'hello-elementor'),
link: helloAdminData.actionLinkURL
},
'activate-elementor': {
image: helloAdminData.templateDirectoryURI + '/assets/images/elementor.svg',
alt: (0, _i18n.__)('Elementor', 'hello-elementor'),
title: (0, _i18n.__)('Activate Elementor', 'hello-elementor'),
message: (0, _i18n.__)('Create cross-site header & footer using Elementor.', 'hello-elementor'),
button: (0, _i18n.__)('Activate Elementor', 'hello-elementor'),
link: helloAdminData.actionLinkURL
},
'activate-header-footer-experiment': {
image: helloAdminData.templateDirectoryURI + '/assets/images/elementor.svg',
alt: (0, _i18n.__)('Elementor', 'hello-elementor'),
title: (0, _i18n.__)('Style using Elementor', 'hello-elementor'),
message: (0, _i18n.__)('Design your cross-site header & footer from Elementors "Site Settings" panel.', 'hello-elementor'),
button: (0, _i18n.__)('Activate header & footer experiment', 'hello-elementor'),
link: helloAdminData.actionLinkURL
},
'style-header-footer': {
image: helloAdminData.templateDirectoryURI + '/assets/images/elementor.svg',
alt: (0, _i18n.__)('Elementor', 'hello-elementor'),
title: (0, _i18n.__)('Style cross-site header & footer', 'hello-elementor'),
message: (0, _i18n.__)('Customize your cross-site header & footer from Elementors "Site Settings" panel.', 'hello-elementor'),
button: (0, _i18n.__)('Start Designing', 'hello-elementor'),
link: helloAdminData.actionLinkURL
}
};
const ActionLinksPanel = () => {
if (!helloAdminData.actionLinkType) {
return;
}
return /*#__PURE__*/React.createElement(_actionLinks.ActionLinks, actionLinks[helloAdminData.actionLinkType]);
};
exports.ActionLinksPanel = ActionLinksPanel;
/***/ }),
/***/ 230:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports.SettingsPanel = void 0;
var _i18n = __webpack_require__(736);
var _components = __webpack_require__(609);
const SettingsPanel = ({
SETTINGS,
settingsData,
updateSettings
}) => {
const protocol = window.location.protocol || 'https:';
const hostname = window.location.hostname || 'example.com';
const prefix = protocol + '//' + hostname;
return /*#__PURE__*/React.createElement(_components.PanelBody, {
title: (0, _i18n.__)('Hello Theme Settings', 'hello-elementor')
}, /*#__PURE__*/React.createElement(_components.Notice, {
status: "warning",
isDismissible: "false"
}, /*#__PURE__*/React.createElement(_components.Dashicon, {
icon: "flag"
}), (0, _i18n.__)('Be cautious, disabling some of the following options may break your website.', 'hello-elementor')), /*#__PURE__*/React.createElement(_components.ToggleControl, {
label: (0, _i18n.__)('Disable description meta tag', 'hello-elementor'),
help: (0, _i18n.__)('Remove the description meta tag in singular content pages that contain an excerpt.', 'hello-elementor'),
checked: !!settingsData[SETTINGS.DESCRIPTION_META_TAG] || false,
onChange: value => updateSettings(SETTINGS.DESCRIPTION_META_TAG, value)
}), /*#__PURE__*/React.createElement("code", {
className: "code-example"
}, " <meta name=\"description\" content=\"...\" /> "), /*#__PURE__*/React.createElement(_components.ToggleControl, {
label: (0, _i18n.__)('Disable skip link', 'hello-elementor'),
help: (0, _i18n.__)('Remove the "Skip to content" link used by screen-readers and users navigating with a keyboard.', 'hello-elementor'),
checked: !!settingsData[SETTINGS.SKIP_LINK] || false,
onChange: value => updateSettings(SETTINGS.SKIP_LINK, value)
}), /*#__PURE__*/React.createElement("code", {
className: "code-example"
}, " <a class=\"skip-link screen-reader-text\" href=\"#content\"> Skip to content </a> "), /*#__PURE__*/React.createElement(_components.ToggleControl, {
label: (0, _i18n.__)('Disable cross-site header & footer', 'hello-elementor'),
help: (0, _i18n.__)('Remove the header & footer sections from all pages, and their CSS/JS files.', 'hello-elementor'),
checked: !!settingsData[SETTINGS.HEADER_FOOTER] || false,
onChange: value => updateSettings(SETTINGS.HEADER_FOOTER, value)
}), /*#__PURE__*/React.createElement("code", {
className: "code-example"
}, " <header id=\"site-header\" class=\"site-header\"> ... </header> "), /*#__PURE__*/React.createElement("code", {
className: "code-example"
}, " <footer id=\"site-footer\" class=\"site-footer\"> ... </footer> "), /*#__PURE__*/React.createElement(_components.ToggleControl, {
label: (0, _i18n.__)('Disable page title', 'hello-elementor'),
help: (0, _i18n.__)('Remove the section above the content that contains the main heading of the page.', 'hello-elementor'),
checked: !!settingsData[SETTINGS.PAGE_TITLE] || false,
onChange: value => updateSettings(SETTINGS.PAGE_TITLE, value)
}), /*#__PURE__*/React.createElement("code", {
className: "code-example"
}, " <header class=\"page-header\"> <h1 class=\"entry-title\"> Post title </h1> </header> "), /*#__PURE__*/React.createElement(_components.ToggleControl, {
label: (0, _i18n.__)('Unregister Hello style.css', 'hello-elementor'),
help: (0, _i18n.__)("Disable Hello theme's style.css file which contains CSS reset rules for unified cross-browser view.", 'hello-elementor'),
checked: !!settingsData[SETTINGS.HELLO_STYLE] || false,
onChange: value => updateSettings(SETTINGS.HELLO_STYLE, value)
}), /*#__PURE__*/React.createElement("code", {
className: "code-example"
}, " <link rel=\"stylesheet\" href=\"", prefix, "/wp-content/themes/hello-elementor/style.min.css\" /> "), /*#__PURE__*/React.createElement(_components.ToggleControl, {
label: (0, _i18n.__)('Unregister Hello theme.css', 'hello-elementor'),
help: (0, _i18n.__)("Disable Hello theme's theme.css file which contains CSS rules that style WordPress elements.", 'hello-elementor'),
checked: !!settingsData[SETTINGS.HELLO_THEME] || false,
onChange: value => updateSettings(SETTINGS.HELLO_THEME, value)
}), /*#__PURE__*/React.createElement("code", {
className: "code-example"
}, " <link rel=\"stylesheet\" href=\"", prefix, "/wp-content/themes/hello-elementor/theme.min.css\" /> "));
};
exports.SettingsPanel = SettingsPanel;
/***/ }),
/***/ 100:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
// extracted by mini-css-extract-plugin
/***/ }),
/***/ 196:
/***/ ((module) => {
"use strict";
module.exports = window["React"];
/***/ }),
/***/ 101:
/***/ ((module) => {
"use strict";
module.exports = window["wp"]["api"];
/***/ }),
/***/ 609:
/***/ ((module) => {
"use strict";
module.exports = window["wp"]["components"];
/***/ }),
/***/ 818:
/***/ ((module) => {
"use strict";
module.exports = window["wp"]["data"];
/***/ }),
/***/ 307:
/***/ ((module) => {
"use strict";
module.exports = window["wp"]["element"];
/***/ }),
/***/ 736:
/***/ ((module) => {
"use strict";
module.exports = window["wp"]["i18n"];
/***/ }),
/***/ 961:
/***/ ((module) => {
"use strict";
module.exports = window["wp"]["notices"];
/***/ }),
/***/ 836:
/***/ ((module) => {
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
"default": obj
};
}
module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports;
/***/ })
/******/ });
/************************************************************************/
/******/ // The module cache
/******/ var __webpack_module_cache__ = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ var cachedModule = __webpack_module_cache__[moduleId];
/******/ if (cachedModule !== undefined) {
/******/ return cachedModule.exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = __webpack_module_cache__[moduleId] = {
/******/ // no module.id needed
/******/ // no module.loaded needed
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/************************************************************************/
/******/ /* webpack/runtime/make namespace object */
/******/ (() => {
/******/ // define __esModule on exports
/******/ __webpack_require__.r = (exports) => {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/ })();
/******/
/************************************************************************/
var __webpack_exports__ = {};
// This entry need to be wrapped in an IIFE because it need to be in strict mode.
(() => {
"use strict";
__webpack_require__(100);
var _element = __webpack_require__(307);
var _settingsPage = __webpack_require__(3);
const App = () => {
return /*#__PURE__*/React.createElement(_settingsPage.SettingsPage, null);
};
document.addEventListener('DOMContentLoaded', () => {
const rootElement = document.getElementById('hello-elementor-settings');
if (rootElement) {
(0, _element.render)( /*#__PURE__*/React.createElement(App, null), rootElement);
}
});
})();
/******/ })()
;

View File

@@ -0,0 +1 @@
<?php return array('dependencies' => array(), 'version' => 'e467b0db4be3ce9829ae');

View File

@@ -0,0 +1,395 @@
/******/ (() => { // webpackBootstrap
/******/ var __webpack_modules__ = ({
/***/ 440:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
"use strict";
var _interopRequireDefault = __webpack_require__(836);
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports["default"] = void 0;
var _defineProperty2 = _interopRequireDefault(__webpack_require__(416));
var _controlsHook = _interopRequireDefault(__webpack_require__(841));
class _default extends $e.modules.ComponentBase {
constructor(...args) {
super(...args);
(0, _defineProperty2.default)(this, "pages", {});
}
getNamespace() {
return 'hello-elementor';
}
defaultHooks() {
return this.importHooks({
ControlsHook: _controlsHook.default
});
}
}
exports["default"] = _default;
/***/ }),
/***/ 841:
/***/ ((__unused_webpack_module, exports) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports["default"] = void 0;
class ControlsHook extends $e.modules.hookUI.After {
getCommand() {
// Command to listen.
return 'document/elements/settings';
}
getId() {
// Unique id for the hook.
return 'hello-elementor-editor-controls-handler';
}
/**
* Get Hello Elementor Theme Controls
*
* Returns an object in which the keys are control IDs, and the values are the selectors of the elements that need
* to be targeted in the apply() method.
*
* Example return value:
* {
* hello_elementor_show_logo: '.site-header .site-header-logo',
* hello_elementor_show_menu: '.site-header .site-header-menu',
* }
*/
getHelloThemeControls() {
return {
hello_header_logo_display: {
selector: '.site-header .site-logo, .site-header .site-title',
callback: ($element, args) => {
this.toggleShowHideClass($element, args.settings.hello_header_logo_display);
}
},
hello_header_menu_display: {
selector: '.site-header .site-navigation, .site-header .site-navigation-toggle-holder',
callback: ($element, args) => {
this.toggleShowHideClass($element, args.settings.hello_header_menu_display);
}
},
hello_header_tagline_display: {
selector: '.site-header .site-description',
callback: ($element, args) => {
this.toggleShowHideClass($element, args.settings.hello_header_tagline_display);
}
},
hello_header_logo_type: {
selector: '.site-header .site-branding',
callback: ($element, args) => {
const classPrefix = 'show-',
inputOptions = args.container.controls.hello_header_logo_type.options,
inputValue = args.settings.hello_header_logo_type;
this.toggleLayoutClass($element, classPrefix, inputOptions, inputValue);
}
},
hello_header_layout: {
selector: '.site-header',
callback: ($element, args) => {
const classPrefix = 'header-',
inputOptions = args.container.controls.hello_header_layout.options,
inputValue = args.settings.hello_header_layout;
this.toggleLayoutClass($element, classPrefix, inputOptions, inputValue);
}
},
hello_header_width: {
selector: '.site-header',
callback: ($element, args) => {
const classPrefix = 'header-',
inputOptions = args.container.controls.hello_header_width.options,
inputValue = args.settings.hello_header_width;
this.toggleLayoutClass($element, classPrefix, inputOptions, inputValue);
}
},
hello_header_menu_layout: {
selector: '.site-header',
callback: ($element, args) => {
const classPrefix = 'menu-layout-',
inputOptions = args.container.controls.hello_header_menu_layout.options,
inputValue = args.settings.hello_header_menu_layout;
// No matter what, close the mobile menu
$element.find('.site-navigation-toggle-holder').removeClass('elementor-active');
$element.find('.site-navigation-dropdown').removeClass('show');
this.toggleLayoutClass($element, classPrefix, inputOptions, inputValue);
}
},
hello_header_menu_dropdown: {
selector: '.site-header',
callback: ($element, args) => {
const classPrefix = 'menu-dropdown-',
inputOptions = args.container.controls.hello_header_menu_dropdown.options,
inputValue = args.settings.hello_header_menu_dropdown;
this.toggleLayoutClass($element, classPrefix, inputOptions, inputValue);
}
},
hello_footer_logo_display: {
selector: '.site-footer .site-logo, .site-footer .site-title',
callback: ($element, args) => {
this.toggleShowHideClass($element, args.settings.hello_footer_logo_display);
}
},
hello_footer_tagline_display: {
selector: '.site-footer .site-description',
callback: ($element, args) => {
this.toggleShowHideClass($element, args.settings.hello_footer_tagline_display);
}
},
hello_footer_menu_display: {
selector: '.site-footer .site-navigation',
callback: ($element, args) => {
this.toggleShowHideClass($element, args.settings.hello_footer_menu_display);
}
},
hello_footer_copyright_display: {
selector: '.site-footer .copyright',
callback: ($element, args) => {
const $footerContainer = $element.closest('#site-footer'),
inputValue = args.settings.hello_footer_copyright_display;
this.toggleShowHideClass($element, inputValue);
$footerContainer.toggleClass('footer-has-copyright', 'yes' === inputValue);
}
},
hello_footer_logo_type: {
selector: '.site-footer .site-branding',
callback: ($element, args) => {
const classPrefix = 'show-',
inputOptions = args.container.controls.hello_footer_logo_type.options,
inputValue = args.settings.hello_footer_logo_type;
this.toggleLayoutClass($element, classPrefix, inputOptions, inputValue);
}
},
hello_footer_layout: {
selector: '.site-footer',
callback: ($element, args) => {
const classPrefix = 'footer-',
inputOptions = args.container.controls.hello_footer_layout.options,
inputValue = args.settings.hello_footer_layout;
this.toggleLayoutClass($element, classPrefix, inputOptions, inputValue);
}
},
hello_footer_width: {
selector: '.site-footer',
callback: ($element, args) => {
const classPrefix = 'footer-',
inputOptions = args.container.controls.hello_footer_width.options,
inputValue = args.settings.hello_footer_width;
this.toggleLayoutClass($element, classPrefix, inputOptions, inputValue);
}
},
hello_footer_copyright_text: {
selector: '.site-footer .copyright',
callback: ($element, args) => {
const inputValue = args.settings.hello_footer_copyright_text;
$element.find('p').text(inputValue);
}
}
};
}
/**
* Toggle show and hide classes on containers
*
* This will remove the .show and .hide clases from the element, then apply the new class
*
* @param {jQuery} element
* @param {string} inputValue
*/
toggleShowHideClass(element, inputValue) {
element.removeClass('hide').removeClass('show').addClass(inputValue ? 'show' : 'hide');
}
/**
* Toggle layout classes on containers
*
* This will cleanly set classes onto which ever container we want to target, removing the old classes and adding the new one
*
* @param {jQuery} element
* @param {string} classPrefix
* @param {Object} inputOptions
* @param {string} inputValue
*
*/
toggleLayoutClass(element, classPrefix, inputOptions, inputValue) {
// Loop through the possible classes and remove the one that's not in use
Object.entries(inputOptions).forEach(([key]) => {
element.removeClass(classPrefix + key);
});
// Append the class which we want to use onto the element
if ('' !== inputValue) {
element.addClass(classPrefix + inputValue);
}
}
/**
* Set the conditions under which the hook will run.
*
* @param {Object} args
*/
getConditions(args) {
const isKit = 'kit' === elementor.documents.getCurrent().config.type,
changedControls = Object.keys(args.settings),
isSingleSetting = 1 === changedControls.length;
// If the document is not a kit, or there are no changed settings, or there is more than one single changed
// setting, don't run the hook.
if (!isKit || !args.settings || !isSingleSetting) {
return false;
}
// If the changed control is in the list of theme controls, return true to run the hook.
// Otherwise, return false so the hook doesn't run.
return !!Object.keys(this.getHelloThemeControls()).includes(changedControls[0]);
}
/**
* The hook logic.
*
* @param {Object} args
*/
apply(args) {
const allThemeControls = this.getHelloThemeControls(),
// Extract the control ID from the passed args
controlId = Object.keys(args.settings)[0],
controlConfig = allThemeControls[controlId],
// Find the element that needs to be targeted by the control.
$element = elementor.$previewContents.find(controlConfig.selector);
controlConfig.callback($element, args);
}
}
exports["default"] = ControlsHook;
/***/ }),
/***/ 416:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
var toPropertyKey = __webpack_require__(62);
function _defineProperty(obj, key, value) {
key = toPropertyKey(key);
if (key in obj) {
Object.defineProperty(obj, key, {
value: value,
enumerable: true,
configurable: true,
writable: true
});
} else {
obj[key] = value;
}
return obj;
}
module.exports = _defineProperty, module.exports.__esModule = true, module.exports["default"] = module.exports;
/***/ }),
/***/ 836:
/***/ ((module) => {
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
"default": obj
};
}
module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports;
/***/ }),
/***/ 36:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
var _typeof = (__webpack_require__(698)["default"]);
function _toPrimitive(input, hint) {
if (_typeof(input) !== "object" || input === null) return input;
var prim = input[Symbol.toPrimitive];
if (prim !== undefined) {
var res = prim.call(input, hint || "default");
if (_typeof(res) !== "object") return res;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
return (hint === "string" ? String : Number)(input);
}
module.exports = _toPrimitive, module.exports.__esModule = true, module.exports["default"] = module.exports;
/***/ }),
/***/ 62:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
var _typeof = (__webpack_require__(698)["default"]);
var toPrimitive = __webpack_require__(36);
function _toPropertyKey(arg) {
var key = toPrimitive(arg, "string");
return _typeof(key) === "symbol" ? key : String(key);
}
module.exports = _toPropertyKey, module.exports.__esModule = true, module.exports["default"] = module.exports;
/***/ }),
/***/ 698:
/***/ ((module) => {
function _typeof(obj) {
"@babel/helpers - typeof";
return (module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
return typeof obj;
} : function (obj) {
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
}, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(obj);
}
module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
/***/ })
/******/ });
/************************************************************************/
/******/ // The module cache
/******/ var __webpack_module_cache__ = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ var cachedModule = __webpack_module_cache__[moduleId];
/******/ if (cachedModule !== undefined) {
/******/ return cachedModule.exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = __webpack_module_cache__[moduleId] = {
/******/ // no module.id needed
/******/ // no module.loaded needed
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/************************************************************************/
var __webpack_exports__ = {};
// This entry need to be wrapped in an IIFE because it need to be in strict mode.
(() => {
"use strict";
var _interopRequireDefault = __webpack_require__(836);
var _component = _interopRequireDefault(__webpack_require__(440));
$e.components.register(new _component.default());
})();
/******/ })()
;

View File

@@ -0,0 +1,395 @@
/******/ (() => { // webpackBootstrap
/******/ var __webpack_modules__ = ({
/***/ 440:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
"use strict";
var _interopRequireDefault = __webpack_require__(836);
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports["default"] = void 0;
var _defineProperty2 = _interopRequireDefault(__webpack_require__(416));
var _controlsHook = _interopRequireDefault(__webpack_require__(841));
class _default extends $e.modules.ComponentBase {
constructor(...args) {
super(...args);
(0, _defineProperty2.default)(this, "pages", {});
}
getNamespace() {
return 'hello-elementor';
}
defaultHooks() {
return this.importHooks({
ControlsHook: _controlsHook.default
});
}
}
exports["default"] = _default;
/***/ }),
/***/ 841:
/***/ ((__unused_webpack_module, exports) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports["default"] = void 0;
class ControlsHook extends $e.modules.hookUI.After {
getCommand() {
// Command to listen.
return 'document/elements/settings';
}
getId() {
// Unique id for the hook.
return 'hello-elementor-editor-controls-handler';
}
/**
* Get Hello Elementor Theme Controls
*
* Returns an object in which the keys are control IDs, and the values are the selectors of the elements that need
* to be targeted in the apply() method.
*
* Example return value:
* {
* hello_elementor_show_logo: '.site-header .site-header-logo',
* hello_elementor_show_menu: '.site-header .site-header-menu',
* }
*/
getHelloThemeControls() {
return {
hello_header_logo_display: {
selector: '.site-header .site-logo, .site-header .site-title',
callback: ($element, args) => {
this.toggleShowHideClass($element, args.settings.hello_header_logo_display);
}
},
hello_header_menu_display: {
selector: '.site-header .site-navigation, .site-header .site-navigation-toggle-holder',
callback: ($element, args) => {
this.toggleShowHideClass($element, args.settings.hello_header_menu_display);
}
},
hello_header_tagline_display: {
selector: '.site-header .site-description',
callback: ($element, args) => {
this.toggleShowHideClass($element, args.settings.hello_header_tagline_display);
}
},
hello_header_logo_type: {
selector: '.site-header .site-branding',
callback: ($element, args) => {
const classPrefix = 'show-',
inputOptions = args.container.controls.hello_header_logo_type.options,
inputValue = args.settings.hello_header_logo_type;
this.toggleLayoutClass($element, classPrefix, inputOptions, inputValue);
}
},
hello_header_layout: {
selector: '.site-header',
callback: ($element, args) => {
const classPrefix = 'header-',
inputOptions = args.container.controls.hello_header_layout.options,
inputValue = args.settings.hello_header_layout;
this.toggleLayoutClass($element, classPrefix, inputOptions, inputValue);
}
},
hello_header_width: {
selector: '.site-header',
callback: ($element, args) => {
const classPrefix = 'header-',
inputOptions = args.container.controls.hello_header_width.options,
inputValue = args.settings.hello_header_width;
this.toggleLayoutClass($element, classPrefix, inputOptions, inputValue);
}
},
hello_header_menu_layout: {
selector: '.site-header',
callback: ($element, args) => {
const classPrefix = 'menu-layout-',
inputOptions = args.container.controls.hello_header_menu_layout.options,
inputValue = args.settings.hello_header_menu_layout;
// No matter what, close the mobile menu
$element.find('.site-navigation-toggle-holder').removeClass('elementor-active');
$element.find('.site-navigation-dropdown').removeClass('show');
this.toggleLayoutClass($element, classPrefix, inputOptions, inputValue);
}
},
hello_header_menu_dropdown: {
selector: '.site-header',
callback: ($element, args) => {
const classPrefix = 'menu-dropdown-',
inputOptions = args.container.controls.hello_header_menu_dropdown.options,
inputValue = args.settings.hello_header_menu_dropdown;
this.toggleLayoutClass($element, classPrefix, inputOptions, inputValue);
}
},
hello_footer_logo_display: {
selector: '.site-footer .site-logo, .site-footer .site-title',
callback: ($element, args) => {
this.toggleShowHideClass($element, args.settings.hello_footer_logo_display);
}
},
hello_footer_tagline_display: {
selector: '.site-footer .site-description',
callback: ($element, args) => {
this.toggleShowHideClass($element, args.settings.hello_footer_tagline_display);
}
},
hello_footer_menu_display: {
selector: '.site-footer .site-navigation',
callback: ($element, args) => {
this.toggleShowHideClass($element, args.settings.hello_footer_menu_display);
}
},
hello_footer_copyright_display: {
selector: '.site-footer .copyright',
callback: ($element, args) => {
const $footerContainer = $element.closest('#site-footer'),
inputValue = args.settings.hello_footer_copyright_display;
this.toggleShowHideClass($element, inputValue);
$footerContainer.toggleClass('footer-has-copyright', 'yes' === inputValue);
}
},
hello_footer_logo_type: {
selector: '.site-footer .site-branding',
callback: ($element, args) => {
const classPrefix = 'show-',
inputOptions = args.container.controls.hello_footer_logo_type.options,
inputValue = args.settings.hello_footer_logo_type;
this.toggleLayoutClass($element, classPrefix, inputOptions, inputValue);
}
},
hello_footer_layout: {
selector: '.site-footer',
callback: ($element, args) => {
const classPrefix = 'footer-',
inputOptions = args.container.controls.hello_footer_layout.options,
inputValue = args.settings.hello_footer_layout;
this.toggleLayoutClass($element, classPrefix, inputOptions, inputValue);
}
},
hello_footer_width: {
selector: '.site-footer',
callback: ($element, args) => {
const classPrefix = 'footer-',
inputOptions = args.container.controls.hello_footer_width.options,
inputValue = args.settings.hello_footer_width;
this.toggleLayoutClass($element, classPrefix, inputOptions, inputValue);
}
},
hello_footer_copyright_text: {
selector: '.site-footer .copyright',
callback: ($element, args) => {
const inputValue = args.settings.hello_footer_copyright_text;
$element.find('p').text(inputValue);
}
}
};
}
/**
* Toggle show and hide classes on containers
*
* This will remove the .show and .hide clases from the element, then apply the new class
*
* @param {jQuery} element
* @param {string} inputValue
*/
toggleShowHideClass(element, inputValue) {
element.removeClass('hide').removeClass('show').addClass(inputValue ? 'show' : 'hide');
}
/**
* Toggle layout classes on containers
*
* This will cleanly set classes onto which ever container we want to target, removing the old classes and adding the new one
*
* @param {jQuery} element
* @param {string} classPrefix
* @param {Object} inputOptions
* @param {string} inputValue
*
*/
toggleLayoutClass(element, classPrefix, inputOptions, inputValue) {
// Loop through the possible classes and remove the one that's not in use
Object.entries(inputOptions).forEach(([key]) => {
element.removeClass(classPrefix + key);
});
// Append the class which we want to use onto the element
if ('' !== inputValue) {
element.addClass(classPrefix + inputValue);
}
}
/**
* Set the conditions under which the hook will run.
*
* @param {Object} args
*/
getConditions(args) {
const isKit = 'kit' === elementor.documents.getCurrent().config.type,
changedControls = Object.keys(args.settings),
isSingleSetting = 1 === changedControls.length;
// If the document is not a kit, or there are no changed settings, or there is more than one single changed
// setting, don't run the hook.
if (!isKit || !args.settings || !isSingleSetting) {
return false;
}
// If the changed control is in the list of theme controls, return true to run the hook.
// Otherwise, return false so the hook doesn't run.
return !!Object.keys(this.getHelloThemeControls()).includes(changedControls[0]);
}
/**
* The hook logic.
*
* @param {Object} args
*/
apply(args) {
const allThemeControls = this.getHelloThemeControls(),
// Extract the control ID from the passed args
controlId = Object.keys(args.settings)[0],
controlConfig = allThemeControls[controlId],
// Find the element that needs to be targeted by the control.
$element = elementor.$previewContents.find(controlConfig.selector);
controlConfig.callback($element, args);
}
}
exports["default"] = ControlsHook;
/***/ }),
/***/ 416:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
var toPropertyKey = __webpack_require__(62);
function _defineProperty(obj, key, value) {
key = toPropertyKey(key);
if (key in obj) {
Object.defineProperty(obj, key, {
value: value,
enumerable: true,
configurable: true,
writable: true
});
} else {
obj[key] = value;
}
return obj;
}
module.exports = _defineProperty, module.exports.__esModule = true, module.exports["default"] = module.exports;
/***/ }),
/***/ 836:
/***/ ((module) => {
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
"default": obj
};
}
module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports;
/***/ }),
/***/ 36:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
var _typeof = (__webpack_require__(698)["default"]);
function _toPrimitive(input, hint) {
if (_typeof(input) !== "object" || input === null) return input;
var prim = input[Symbol.toPrimitive];
if (prim !== undefined) {
var res = prim.call(input, hint || "default");
if (_typeof(res) !== "object") return res;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
return (hint === "string" ? String : Number)(input);
}
module.exports = _toPrimitive, module.exports.__esModule = true, module.exports["default"] = module.exports;
/***/ }),
/***/ 62:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
var _typeof = (__webpack_require__(698)["default"]);
var toPrimitive = __webpack_require__(36);
function _toPropertyKey(arg) {
var key = toPrimitive(arg, "string");
return _typeof(key) === "symbol" ? key : String(key);
}
module.exports = _toPropertyKey, module.exports.__esModule = true, module.exports["default"] = module.exports;
/***/ }),
/***/ 698:
/***/ ((module) => {
function _typeof(obj) {
"@babel/helpers - typeof";
return (module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
return typeof obj;
} : function (obj) {
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
}, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(obj);
}
module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
/***/ })
/******/ });
/************************************************************************/
/******/ // The module cache
/******/ var __webpack_module_cache__ = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ var cachedModule = __webpack_module_cache__[moduleId];
/******/ if (cachedModule !== undefined) {
/******/ return cachedModule.exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = __webpack_module_cache__[moduleId] = {
/******/ // no module.id needed
/******/ // no module.loaded needed
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/************************************************************************/
var __webpack_exports__ = {};
// This entry need to be wrapped in an IIFE because it need to be in strict mode.
(() => {
"use strict";
var _interopRequireDefault = __webpack_require__(836);
var _component = _interopRequireDefault(__webpack_require__(440));
$e.components.register(new _component.default());
})();
/******/ })()
;

View File

@@ -0,0 +1 @@
<?php return array('dependencies' => array(), 'version' => 'ac1edb44e0c7550dfdd9');

View File

@@ -0,0 +1,75 @@
/******/ (() => { // webpackBootstrap
/******/ "use strict";
var __webpack_exports__ = {};
class elementorHelloThemeHandler {
constructor() {
this.initSettings();
this.initElements();
this.bindEvents();
}
initSettings() {
this.settings = {
selectors: {
menuToggle: '.site-header .site-navigation-toggle',
menuToggleHolder: '.site-header .site-navigation-toggle-holder',
dropdownMenu: '.site-header .site-navigation-dropdown'
}
};
}
initElements() {
this.elements = {
window,
menuToggle: document.querySelector(this.settings.selectors.menuToggle),
menuToggleHolder: document.querySelector(this.settings.selectors.menuToggleHolder),
dropdownMenu: document.querySelector(this.settings.selectors.dropdownMenu)
};
}
bindEvents() {
var _this$elements$menuTo;
if (!this.elements.menuToggleHolder || (_this$elements$menuTo = this.elements.menuToggleHolder) !== null && _this$elements$menuTo !== void 0 && _this$elements$menuTo.classList.contains('hide')) {
return;
}
this.elements.menuToggle.addEventListener('click', () => this.handleMenuToggle());
this.elements.menuToggle.addEventListener('keyup', event => {
const ENTER_KEY = 13;
const SPACE_KEY = 32;
if (ENTER_KEY === event.keyCode || SPACE_KEY === event.keyCode) {
event.currentTarget.click();
}
});
this.elements.dropdownMenu.querySelectorAll('.menu-item-has-children > a').forEach(anchorElement => anchorElement.addEventListener('click', event => this.handleMenuChildren(event)));
}
closeMenuItems() {
this.elements.menuToggleHolder.classList.remove('elementor-active');
this.elements.window.removeEventListener('resize', () => this.closeMenuItems());
}
handleMenuToggle() {
const isDropdownVisible = !this.elements.menuToggleHolder.classList.contains('elementor-active');
this.elements.menuToggle.setAttribute('aria-expanded', isDropdownVisible);
this.elements.dropdownMenu.setAttribute('aria-hidden', !isDropdownVisible);
this.elements.menuToggleHolder.classList.toggle('elementor-active', isDropdownVisible);
// Always close all sub active items.
this.elements.dropdownMenu.querySelectorAll('.elementor-active').forEach(item => item.classList.remove('elementor-active'));
if (isDropdownVisible) {
this.elements.window.addEventListener('resize', () => this.closeMenuItems());
} else {
this.elements.window.removeEventListener('resize', () => this.closeMenuItems());
}
}
handleMenuChildren(event) {
const anchor = event.currentTarget;
const parentLi = anchor.parentElement;
if (!(parentLi !== null && parentLi !== void 0 && parentLi.classList)) {
return;
}
parentLi.classList.toggle('elementor-active');
}
}
document.addEventListener('DOMContentLoaded', () => {
new elementorHelloThemeHandler();
});
/******/ })()
;

View File

@@ -0,0 +1,75 @@
/******/ (() => { // webpackBootstrap
/******/ "use strict";
var __webpack_exports__ = {};
class elementorHelloThemeHandler {
constructor() {
this.initSettings();
this.initElements();
this.bindEvents();
}
initSettings() {
this.settings = {
selectors: {
menuToggle: '.site-header .site-navigation-toggle',
menuToggleHolder: '.site-header .site-navigation-toggle-holder',
dropdownMenu: '.site-header .site-navigation-dropdown'
}
};
}
initElements() {
this.elements = {
window,
menuToggle: document.querySelector(this.settings.selectors.menuToggle),
menuToggleHolder: document.querySelector(this.settings.selectors.menuToggleHolder),
dropdownMenu: document.querySelector(this.settings.selectors.dropdownMenu)
};
}
bindEvents() {
var _this$elements$menuTo;
if (!this.elements.menuToggleHolder || (_this$elements$menuTo = this.elements.menuToggleHolder) !== null && _this$elements$menuTo !== void 0 && _this$elements$menuTo.classList.contains('hide')) {
return;
}
this.elements.menuToggle.addEventListener('click', () => this.handleMenuToggle());
this.elements.menuToggle.addEventListener('keyup', event => {
const ENTER_KEY = 13;
const SPACE_KEY = 32;
if (ENTER_KEY === event.keyCode || SPACE_KEY === event.keyCode) {
event.currentTarget.click();
}
});
this.elements.dropdownMenu.querySelectorAll('.menu-item-has-children > a').forEach(anchorElement => anchorElement.addEventListener('click', event => this.handleMenuChildren(event)));
}
closeMenuItems() {
this.elements.menuToggleHolder.classList.remove('elementor-active');
this.elements.window.removeEventListener('resize', () => this.closeMenuItems());
}
handleMenuToggle() {
const isDropdownVisible = !this.elements.menuToggleHolder.classList.contains('elementor-active');
this.elements.menuToggle.setAttribute('aria-expanded', isDropdownVisible);
this.elements.dropdownMenu.setAttribute('aria-hidden', !isDropdownVisible);
this.elements.menuToggleHolder.classList.toggle('elementor-active', isDropdownVisible);
// Always close all sub active items.
this.elements.dropdownMenu.querySelectorAll('.elementor-active').forEach(item => item.classList.remove('elementor-active'));
if (isDropdownVisible) {
this.elements.window.addEventListener('resize', () => this.closeMenuItems());
} else {
this.elements.window.removeEventListener('resize', () => this.closeMenuItems());
}
}
handleMenuChildren(event) {
const anchor = event.currentTarget;
const parentLi = anchor.parentElement;
if (!(parentLi !== null && parentLi !== void 0 && parentLi.classList)) {
return;
}
parentLi.classList.toggle('elementor-active');
}
}
document.addEventListener('DOMContentLoaded', () => {
new elementorHelloThemeHandler();
});
/******/ })()
;

View File

@@ -0,0 +1,41 @@
/**
* Classic editor styling
*/
/**
* Loading first in the style.scss & classic-editor.scss
*/
p {
margin-block-end: 0.75rem;
}
img {
max-width: 100%;
height: auto;
vertical-align: middle;
border-style: none;
}
pre {
font-family: monospace;
font-size: 1em;
white-space: pre-wrap;
}
code,
kbd,
pre,
samp {
font-size: 1rem;
}
code,
kbd,
pre,
samp {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
font-size: 1rem;
}
blockquote {
font-style: italic;
}

View File

@@ -0,0 +1 @@
p{margin-block-end:.75rem}img{max-width:100%;height:auto;vertical-align:middle;border-style:none}pre{font-family:monospace;font-size:1em;white-space:pre-wrap}code,kbd,pre,samp{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-size:1rem}blockquote{font-style:italic}

View File

@@ -0,0 +1,80 @@
<?php
/**
* The template for displaying comments.
*
* This is the template that displays the area of the page that contains both the current comments
* and the comment form.
*
* @package HelloElementor
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
if ( ! post_type_supports( get_post_type(), 'comments' ) ) {
return;
}
if ( ! have_comments() && ! comments_open() ) {
return;
}
// Comment Reply Script.
if ( comments_open() && get_option( 'thread_comments' ) ) {
wp_enqueue_script( 'comment-reply' );
}
?>
<section id="comments" class="comments-area">
<?php if ( have_comments() ) : ?>
<h3 class="title-comments">
<?php
$comments_number = get_comments_number();
if ( '1' === $comments_number ) {
printf( esc_html_x( 'One Response', 'comments title', 'hello-elementor' ) );
} else {
printf(
esc_html( /* translators: 1: number of comments */
_nx(
'%1$s Response',
'%1$s Responses',
$comments_number,
'comments title',
'hello-elementor'
)
),
esc_html( number_format_i18n( $comments_number ) )
);
}
?>
</h3>
<?php the_comments_navigation(); ?>
<ol class="comment-list">
<?php
wp_list_comments(
[
'style' => 'ol',
'short_ping' => true,
'avatar_size' => 42,
]
);
?>
</ol><!-- .comment-list -->
<?php the_comments_navigation(); ?>
<?php endif; // Check for have_comments(). ?>
<?php
comment_form(
[
'title_reply_before' => '<h2 id="reply-title" class="comment-reply-title">',
'title_reply_after' => '</h2>',
]
);
?>
</section><!-- .comments-area -->

View File

@@ -0,0 +1,21 @@
/**
* Style for your Customizer editor.
*/
#accordion-section-hello-options .accordion-section-title {
color: #c36;
}
#accordion-section-hello-options .accordion-section-title:after {
color: #c36;
}
#customize-control-hello-header-footer .hello-action-links {
margin: 15px auto;
text-align: center;
}
#customize-control-hello-header-footer .hello-action-links-title {
font-weight: 600;
margin: 10px 0;
}
#customize-control-hello-header-footer .hello-action-links-message {
margin: 0 0 20px;
}

View File

@@ -0,0 +1 @@
#accordion-section-hello-options .accordion-section-title,#accordion-section-hello-options .accordion-section-title:after{color:#c36}#customize-control-hello-header-footer .hello-action-links{margin:15px auto;text-align:center}#customize-control-hello-header-footer .hello-action-links-title{font-weight:600;margin:10px 0}#customize-control-hello-header-footer .hello-action-links-message{margin:0 0 20px}

View File

@@ -0,0 +1,12 @@
/**
* Elementor editor styling
*/
.hello-elementor.elementor-nerd-box .elementor-nerd-box-title {
margin-block-start: 24px;
}
.hello-elementor.elementor-nerd-box .elementor-nerd-box-message {
margin-block-start: 12px;
}
.hello-elementor.elementor-nerd-box .elementor-nerd-box-link {
margin-block-start: 24px;
}

View File

@@ -0,0 +1 @@
.hello-elementor.elementor-nerd-box .elementor-nerd-box-title{margin-block-start:24px}.hello-elementor.elementor-nerd-box .elementor-nerd-box-message{margin-block-start:12px}.hello-elementor.elementor-nerd-box .elementor-nerd-box-link{margin-block-start:24px}

View File

@@ -0,0 +1,28 @@
<?php
/**
* The template for displaying the footer.
*
* Contains the body & html closing tags.
*
* @package HelloElementor
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
if ( ! function_exists( 'elementor_theme_do_location' ) || ! elementor_theme_do_location( 'footer' ) ) {
if ( hello_elementor_display_header_footer() ) {
if ( did_action( 'elementor/loaded' ) && hello_header_footer_experiment_active() ) {
get_template_part( 'template-parts/dynamic-footer' );
} else {
get_template_part( 'template-parts/footer' );
}
}
}
?>
<?php wp_footer(); ?>
</body>
</html>

View File

@@ -0,0 +1,265 @@
<?php
/**
* Theme functions and definitions
*
* @package HelloElementor
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
define( 'HELLO_ELEMENTOR_VERSION', '3.0.1' );
if ( ! isset( $content_width ) ) {
$content_width = 800; // Pixels.
}
if ( ! function_exists( 'hello_elementor_setup' ) ) {
/**
* Set up theme support.
*
* @return void
*/
function hello_elementor_setup() {
if ( is_admin() ) {
hello_maybe_update_theme_version_in_db();
}
if ( apply_filters( 'hello_elementor_register_menus', true ) ) {
register_nav_menus( [ 'menu-1' => esc_html__( 'Header', 'hello-elementor' ) ] );
register_nav_menus( [ 'menu-2' => esc_html__( 'Footer', 'hello-elementor' ) ] );
}
if ( apply_filters( 'hello_elementor_post_type_support', true ) ) {
add_post_type_support( 'page', 'excerpt' );
}
if ( apply_filters( 'hello_elementor_add_theme_support', true ) ) {
add_theme_support( 'post-thumbnails' );
add_theme_support( 'automatic-feed-links' );
add_theme_support( 'title-tag' );
add_theme_support(
'html5',
[
'search-form',
'comment-form',
'comment-list',
'gallery',
'caption',
'script',
'style',
]
);
add_theme_support(
'custom-logo',
[
'height' => 100,
'width' => 350,
'flex-height' => true,
'flex-width' => true,
]
);
/*
* Editor Style.
*/
add_editor_style( 'classic-editor.css' );
/*
* Gutenberg wide images.
*/
add_theme_support( 'align-wide' );
/*
* WooCommerce.
*/
if ( apply_filters( 'hello_elementor_add_woocommerce_support', true ) ) {
// WooCommerce in general.
add_theme_support( 'woocommerce' );
// Enabling WooCommerce product gallery features (are off by default since WC 3.0.0).
// zoom.
add_theme_support( 'wc-product-gallery-zoom' );
// lightbox.
add_theme_support( 'wc-product-gallery-lightbox' );
// swipe.
add_theme_support( 'wc-product-gallery-slider' );
}
}
}
}
add_action( 'after_setup_theme', 'hello_elementor_setup' );
function hello_maybe_update_theme_version_in_db() {
$theme_version_option_name = 'hello_theme_version';
// The theme version saved in the database.
$hello_theme_db_version = get_option( $theme_version_option_name );
// If the 'hello_theme_version' option does not exist in the DB, or the version needs to be updated, do the update.
if ( ! $hello_theme_db_version || version_compare( $hello_theme_db_version, HELLO_ELEMENTOR_VERSION, '<' ) ) {
update_option( $theme_version_option_name, HELLO_ELEMENTOR_VERSION );
}
}
if ( ! function_exists( 'hello_elementor_display_header_footer' ) ) {
/**
* Check whether to display header footer.
*
* @return bool
*/
function hello_elementor_display_header_footer() {
$hello_elementor_header_footer = true;
return apply_filters( 'hello_elementor_header_footer', $hello_elementor_header_footer );
}
}
if ( ! function_exists( 'hello_elementor_scripts_styles' ) ) {
/**
* Theme Scripts & Styles.
*
* @return void
*/
function hello_elementor_scripts_styles() {
$min_suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
if ( apply_filters( 'hello_elementor_enqueue_style', true ) ) {
wp_enqueue_style(
'hello-elementor',
get_template_directory_uri() . '/style' . $min_suffix . '.css',
[],
HELLO_ELEMENTOR_VERSION
);
}
if ( apply_filters( 'hello_elementor_enqueue_theme_style', true ) ) {
wp_enqueue_style(
'hello-elementor-theme-style',
get_template_directory_uri() . '/theme' . $min_suffix . '.css',
[],
HELLO_ELEMENTOR_VERSION
);
}
if ( hello_elementor_display_header_footer() ) {
wp_enqueue_style(
'hello-elementor-header-footer',
get_template_directory_uri() . '/header-footer' . $min_suffix . '.css',
[],
HELLO_ELEMENTOR_VERSION
);
}
}
}
add_action( 'wp_enqueue_scripts', 'hello_elementor_scripts_styles' );
if ( ! function_exists( 'hello_elementor_register_elementor_locations' ) ) {
/**
* Register Elementor Locations.
*
* @param ElementorPro\Modules\ThemeBuilder\Classes\Locations_Manager $elementor_theme_manager theme manager.
*
* @return void
*/
function hello_elementor_register_elementor_locations( $elementor_theme_manager ) {
if ( apply_filters( 'hello_elementor_register_elementor_locations', true ) ) {
$elementor_theme_manager->register_all_core_location();
}
}
}
add_action( 'elementor/theme/register_locations', 'hello_elementor_register_elementor_locations' );
if ( ! function_exists( 'hello_elementor_content_width' ) ) {
/**
* Set default content width.
*
* @return void
*/
function hello_elementor_content_width() {
$GLOBALS['content_width'] = apply_filters( 'hello_elementor_content_width', 800 );
}
}
add_action( 'after_setup_theme', 'hello_elementor_content_width', 0 );
if ( ! function_exists( 'hello_elementor_add_description_meta_tag' ) ) {
/**
* Add description meta tag with excerpt text.
*
* @return void
*/
function hello_elementor_add_description_meta_tag() {
if ( ! apply_filters( 'hello_elementor_description_meta_tag', true ) ) {
return;
}
if ( ! is_singular() ) {
return;
}
$post = get_queried_object();
if ( empty( $post->post_excerpt ) ) {
return;
}
echo '<meta name="description" content="' . esc_attr( wp_strip_all_tags( $post->post_excerpt ) ) . '">' . "\n";
}
}
add_action( 'wp_head', 'hello_elementor_add_description_meta_tag' );
// Admin notice
if ( is_admin() ) {
require get_template_directory() . '/includes/admin-functions.php';
}
// Settings page
require get_template_directory() . '/includes/settings-functions.php';
// Header & footer styling option, inside Elementor
require get_template_directory() . '/includes/elementor-functions.php';
if ( ! function_exists( 'hello_elementor_customizer' ) ) {
// Customizer controls
function hello_elementor_customizer() {
if ( ! is_customize_preview() ) {
return;
}
if ( ! hello_elementor_display_header_footer() ) {
return;
}
require get_template_directory() . '/includes/customizer-functions.php';
}
}
add_action( 'init', 'hello_elementor_customizer' );
if ( ! function_exists( 'hello_elementor_check_hide_title' ) ) {
/**
* Check whether to display the page title.
*
* @param bool $val default value.
*
* @return bool
*/
function hello_elementor_check_hide_title( $val ) {
if ( defined( 'ELEMENTOR_VERSION' ) ) {
$current_doc = Elementor\Plugin::instance()->documents->get( get_the_ID() );
if ( $current_doc && 'yes' === $current_doc->get_settings( 'hide_title' ) ) {
$val = false;
}
}
return $val;
}
}
add_filter( 'hello_elementor_page_title', 'hello_elementor_check_hide_title' );
/**
* BC:
* In v2.7.0 the theme removed the `hello_elementor_body_open()` from `header.php` replacing it with `wp_body_open()`.
* The following code prevents fatal errors in child themes that still use this function.
*/
if ( ! function_exists( 'hello_elementor_body_open' ) ) {
function hello_elementor_body_open() {
wp_body_open();
}
}

View File

@@ -0,0 +1,360 @@
@charset "UTF-8";
/**
* Loading first in the style.scss & classic-editor.scss
*/
/**
* Header styling and layout
*/
.site-header {
/* Backwards compat for Hello 2.3.0 */
display: flex;
flex-wrap: wrap;
justify-content: space-between;
padding-block-start: 1rem;
padding-block-end: 1rem;
position: relative;
}
.site-header .site-navigation {
justify-content: flex-end;
}
.site-header .site-branding {
display: flex;
flex-direction: column;
justify-content: center;
}
.site-header .header-inner {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
}
.site-header .header-inner .custom-logo-link {
display: block;
}
.site-header .header-inner .site-branding .site-title,
.site-header .header-inner .site-branding .site-description {
margin: 0;
}
.site-header .header-inner .site-branding.show-title .site-logo {
display: none !important;
}
.site-header .header-inner .site-branding.show-logo .site-title {
display: none !important;
}
.site-header:not(.header-stacked) .header-inner .site-branding {
max-width: 30%;
}
.site-header:not(.header-stacked) .header-inner .site-navigation {
max-width: 70%;
}
.site-header.header-inverted .header-inner {
flex-direction: row-reverse;
}
.site-header.header-inverted .header-inner .site-branding {
text-align: right;
}
.site-header.header-inverted .header-inner .site-navigation {
justify-content: start;
}
.site-header.header-stacked .header-inner {
align-items: center;
flex-direction: column;
text-align: center;
}
@media (max-width: 576px) {
.site-header .header-inner:not(.header-stacked) .site-branding {
max-width: 80%;
}
}
/**
* Footer styling and layout
*/
.site-footer {
padding-block-start: 1rem;
padding-block-end: 1rem;
position: relative;
}
.site-footer .footer-inner {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
}
.site-footer .footer-inner .custom-logo-link {
display: block;
}
.site-footer .footer-inner .site-navigation {
justify-content: flex-end;
}
.site-footer .footer-inner .site-branding {
display: flex;
flex-direction: column;
justify-content: center;
}
.site-footer .footer-inner .site-branding .site-title,
.site-footer .footer-inner .site-branding .site-description {
margin: 0;
}
.site-footer .footer-inner .site-branding.show-title .site-logo {
display: none !important;
}
.site-footer .footer-inner .site-branding.show-logo .site-title {
display: none !important;
}
.site-footer .footer-inner .copyright {
align-items: center;
display: flex;
justify-content: flex-end;
}
.site-footer .footer-inner .copyright p {
margin: 0;
}
.site-footer.footer-inverted .footer-inner {
flex-direction: row-reverse;
}
.site-footer.footer-inverted .footer-inner .site-branding {
text-align: right;
}
.site-footer.footer-inverted .footer-inner .site-navigation {
justify-content: flex-start;
}
.site-footer.footer-has-copyright .footer-inner .site-navigation {
justify-content: center;
}
.site-footer.footer-stacked .footer-inner {
align-items: center;
flex-direction: column;
text-align: center;
}
.site-footer.footer-stacked .footer-inner .site-branding h4.site-title {
text-align: center;
}
.site-footer.footer-stacked .footer-inner .site-navigation .menu {
padding: 0;
}
.site-footer:not(.footer-stacked) .footer-inner .site-branding {
max-width: 20%;
}
.site-footer:not(.footer-stacked) .footer-inner .site-navigation {
max-width: 60%;
}
.site-footer:not(.footer-stacked) .footer-inner .copyright {
max-width: 20%;
}
@media (max-width: 576px) {
.site-footer:not(.footer-stacked) .footer-inner .site-branding,
.site-footer:not(.footer-stacked) .footer-inner .site-navigation,
.site-footer:not(.footer-stacked) .footer-inner .copyright {
display: block;
text-align: center;
width: 100%;
max-width: none;
}
.site-footer .footer-inner .site-navigation ul.menu {
justify-content: center;
}
.site-footer .footer-inner .site-navigation ul.menu li {
display: inline-block;
}
}
/**
* Navigation Menus
*/
.site-header.header-inverted .site-navigation-toggle-holder {
justify-content: flex-start;
}
.site-header.header-stacked .site-navigation-toggle-holder {
justify-content: center;
max-width: 100%;
}
.site-header.menu-layout-dropdown .site-navigation {
display: none;
}
.site-navigation-toggle-holder {
display: flex;
align-items: center;
justify-content: flex-end;
flex-grow: 1;
max-width: 20%;
padding: 8px 15px;
}
.site-navigation-toggle-holder .site-navigation-toggle {
display: flex;
align-items: center;
justify-content: center;
font-size: 22px;
padding: 0.25em;
cursor: pointer;
border: 0 solid;
border-radius: 3px;
background-color: rgba(0, 0, 0, 0.05);
color: #494c4f;
}
.site-navigation-toggle-holder.elementor-active .site-navigation-toggle i:before {
content: "\e87f";
}
.site-navigation {
grid-area: nav-menu;
display: flex;
align-items: center;
flex-grow: 1;
}
.site-navigation ul.menu, .site-navigation ul.menu ul {
list-style-type: none;
padding: 0;
}
.site-navigation ul.menu {
display: flex;
flex-wrap: wrap;
}
.site-navigation ul.menu li {
position: relative;
display: flex;
}
.site-navigation ul.menu li a {
display: block;
padding: 8px 15px;
}
.site-navigation ul.menu li.menu-item-has-children {
padding-inline-end: 15px;
}
.site-navigation ul.menu li.menu-item-has-children:after {
display: block;
content: "▾";
font-size: 1.5em;
align-items: center;
color: #666666;
position: absolute;
right: 0;
top: 50%;
transform: translateY(-50%);
text-decoration: none;
}
.site-navigation ul.menu li.menu-item-has-children:focus-within > ul {
display: block;
}
.site-navigation ul.menu li ul {
background: #fff;
display: none;
min-width: 150px;
position: absolute;
z-index: 2;
left: 0;
top: 100%;
}
.site-navigation ul.menu li ul li {
border-block-end: #eeeeee 1px solid;
}
.site-navigation ul.menu li ul li:last-child {
border-block-end: none;
}
.site-navigation ul.menu li ul li.menu-item-has-children a {
flex-grow: 1;
}
.site-navigation ul.menu li ul li.menu-item-has-children:after {
transform: translateY(-50%) rotate(-90deg);
}
.site-navigation ul.menu li ul ul {
left: 100%;
top: 0;
}
.site-navigation ul.menu li:hover > ul {
display: block;
}
footer .site-navigation ul.menu li ul {
top: auto;
bottom: 100%;
}
footer .site-navigation ul.menu li ul ul {
bottom: 0;
}
footer .site-navigation ul.menu a {
padding: 5px 15px;
}
.site-navigation-dropdown {
margin-block-start: 10px;
transition: max-height 0.3s, transform 0.3s;
transform-origin: top;
position: absolute;
bottom: 0;
left: 0;
z-index: 10000;
width: 100%;
}
.site-navigation-toggle-holder:not(.elementor-active) + .site-navigation-dropdown {
transform: scaleY(0);
max-height: 0;
}
.site-navigation-toggle-holder.elementor-active + .site-navigation-dropdown {
transform: scaleY(1);
max-height: 100vh;
}
.site-navigation-dropdown ul {
padding: 0;
}
.site-navigation-dropdown ul.menu {
position: absolute;
width: 100%;
padding: 0;
margin: 0;
background: white;
}
.site-navigation-dropdown ul.menu li {
display: block;
width: 100%;
position: relative;
}
.site-navigation-dropdown ul.menu li a {
display: block;
padding: 20px;
background: #ffffff;
color: #55595c;
box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.1019607843);
}
.site-navigation-dropdown ul.menu li.current-menu-item a {
color: white;
background: #55595c;
}
.site-navigation-dropdown ul.menu > li li {
transition: max-height 0.3s, transform 0.3s;
transform-origin: top;
transform: scaleY(0);
max-height: 0;
}
.site-navigation-dropdown ul.menu li.elementor-active > ul > li {
transform: scaleY(1);
max-height: 100vh;
}
@media (max-width: 576px) {
.site-header.menu-dropdown-mobile:not(.menu-layout-dropdown) .site-navigation {
display: none !important;
}
}
@media (min-width: 768px) {
.site-header.menu-dropdown-mobile:not(.menu-layout-dropdown) .site-navigation-toggle-holder {
display: none !important;
}
}
@media (min-width: 576px) and (max-width: 767px) {
.site-header.menu-dropdown-mobile:not(.menu-layout-dropdown) .site-navigation {
display: none !important;
}
}
@media (min-width: 992px) {
.site-header.menu-dropdown-tablet:not(.menu-layout-dropdown) .site-navigation-toggle-holder {
display: none !important;
}
}
@media (max-width: 992px) {
.site-header.menu-dropdown-tablet:not(.menu-layout-dropdown) .site-navigation {
display: none !important;
}
}
.site-header.menu-dropdown-none:not(.menu-layout-dropdown) .site-navigation-toggle-holder {
display: none !important;
}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,43 @@
<?php
/**
* The template for displaying the header
*
* This is the template that displays all of the <head> section, opens the <body> tag and adds the site's header.
*
* @package HelloElementor
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
$viewport_content = apply_filters( 'hello_elementor_viewport_content', 'width=device-width, initial-scale=1' );
$enable_skip_link = apply_filters( 'hello_elementor_enable_skip_link', true );
$skip_link_url = apply_filters( 'hello_elementor_skip_link_url', '#content' );
?>
<!doctype html>
<html <?php language_attributes(); ?>>
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>">
<meta name="viewport" content="<?php echo esc_attr( $viewport_content ); ?>">
<link rel="profile" href="https://gmpg.org/xfn/11">
<?php wp_head(); ?>
</head>
<body <?php body_class(); ?>>
<?php wp_body_open(); ?>
<?php if ( $enable_skip_link ) { ?>
<a class="skip-link screen-reader-text" href="<?php echo esc_url( $skip_link_url ); ?>"><?php echo esc_html__( 'Skip to content', 'hello-elementor' ); ?></a>
<?php } ?>
<?php
if ( ! function_exists( 'elementor_theme_do_location' ) || ! elementor_theme_do_location( 'header' ) ) {
if ( hello_elementor_display_header_footer() ) {
if ( did_action( 'elementor/loaded' ) && hello_header_footer_experiment_active() ) {
get_template_part( 'template-parts/dynamic-header' );
} else {
get_template_part( 'template-parts/header' );
}
}
}

View File

@@ -0,0 +1,159 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
/**
* Show in WP Dashboard notice about the plugin is not activated.
*
* @return void
*/
function hello_elementor_fail_load_admin_notice() {
// Leave to Elementor Pro to manage this.
if ( function_exists( 'elementor_pro_load_plugin' ) ) {
return;
}
$screen = get_current_screen();
if ( isset( $screen->parent_file ) && 'plugins.php' === $screen->parent_file && 'update' === $screen->id ) {
return;
}
if ( 'true' === get_user_meta( get_current_user_id(), '_hello_elementor_install_notice', true ) ) {
return;
}
$plugin = 'elementor/elementor.php';
$installed_plugins = get_plugins();
$is_elementor_installed = isset( $installed_plugins[ $plugin ] );
$message = esc_html__( 'The Hello Theme is a lightweight starter theme that works perfectly with the Elementor award-winning site builder plugin.', 'hello-elementor' );
if ( $is_elementor_installed ) {
if ( ! current_user_can( 'activate_plugins' ) ) {
return;
}
$message .= ' ' . esc_html__( 'Once you activate the plugin, you are only one click away from building an amazing website.', 'hello-elementor' );
$button_text = esc_html__( 'Activate Elementor', 'hello-elementor' );
$button_link = wp_nonce_url( 'plugins.php?action=activate&amp;plugin=' . $plugin . '&amp;plugin_status=all&amp;paged=1&amp;s', 'activate-plugin_' . $plugin );
} else {
if ( ! current_user_can( 'install_plugins' ) ) {
return;
}
$message .= ' ' . esc_html__( 'Once you download and activate the plugin, you are only one click away from building an amazing website.', 'hello-elementor' );
$button_text = esc_html__( 'Install Elementor', 'hello-elementor' );
$button_link = wp_nonce_url( self_admin_url( 'update.php?action=install-plugin&plugin=elementor' ), 'install-plugin_elementor' );
}
?>
<style>
.notice.hello-elementor-notice {
border: 1px solid #ccd0d4;
border-inline-start: 4px solid #9b0a46 !important;
box-shadow: 0 1px 4px rgba(0,0,0,0.15);
display: flex;
padding: 0;
}
.notice.hello-elementor-notice.hello-elementor-install-elementor {
padding: 0;
}
.notice.hello-elementor-notice .hello-elementor-notice-aside {
display: flex;
align-items: start;
justify-content: center;
padding: 20px 10px;
background: rgba(215,43,63,0.04);
}
.notice.hello-elementor-notice .hello-elementor-notice-aside img {
width: 1.5rem;
}
.notice.hello-elementor-notice .hello-elementor-notice-content {
display: flex;
flex-direction: column;
gap: 5px;
padding: 20px;
width: 100%;
}
.notice.hello-elementor-notice .hello-elementor-notice-content h3,
.notice.hello-elementor-notice .hello-elementor-notice-content p {
padding: 0;
margin: 0;
}
.notice.hello-elementor-notice .hello-elementor-information-link {
align-self: start;
}
.notice.hello-elementor-notice .hello-elementor-install-button {
align-self: start;
background-color: #127DB8;
border-radius: 3px;
color: #fff;
text-decoration: none;
height: auto;
line-height: 20px;
padding: 0.4375rem 0.75rem;
margin-block-start: 15px;
}
.notice.hello-elementor-notice .hello-elementor-install-button:active {
transform: translateY(1px);
}
@media (max-width: 767px) {
.notice.hello-elementor-notice .hello-elementor-notice-aside {
padding: 10px;
}
.notice.hello-elementor-notice .hello-elementor-notice-content {
gap: 10px;
padding: 10px;
}
}
</style>
<script>
window.addEventListener( 'load', () => {
const dismissNotice = document.querySelector( '.notice.hello-elementor-install-elementor button.notice-dismiss' );
dismissNotice.addEventListener( 'click', async ( event ) => {
event.preventDefault();
var formData = new FormData();
formData.append( 'action', 'hello_elementor_set_admin_notice_viewed' );
formData.append( 'dismiss_nonce', '<?php echo esc_js( wp_create_nonce( 'hello_elementor_dismiss_install_notice' ) ); ?>' );
await fetch( ajaxurl, { method: 'POST', body: formData } );
} );
} );
</script>
<div class="notice updated is-dismissible hello-elementor-notice hello-elementor-install-elementor">
<div class="hello-elementor-notice-aside">
<img src="<?php echo esc_url( get_template_directory_uri() . '/assets/images/elementor-notice-icon.svg' ); ?>" alt="<?php echo esc_attr__( 'Get Elementor', 'hello-elementor' ); ?>" />
</div>
<div class="hello-elementor-notice-content">
<h3><?php echo esc_html__( 'Thanks for installing the Hello Theme!', 'hello-elementor' ); ?></h3>
<p><?php echo esc_html( $message ); ?></p>
<a class="hello-elementor-information-link" href="https://go.elementor.com/hello-theme-learn/" target="_blank"><?php echo esc_html__( 'Explore Elementor Site Builder Plugin', 'hello-elementor' ); ?></a>
<a class="hello-elementor-install-button" href="<?php echo esc_attr( $button_link ); ?>"><?php echo esc_html( $button_text ); ?></a>
</div>
</div>
<?php
}
/**
* Set dismissed admin notice as viewed.
*
* @return void
*/
function ajax_hello_elementor_set_admin_notice_viewed() {
check_ajax_referer( 'hello_elementor_dismiss_install_notice', 'dismiss_nonce' );
update_user_meta( get_current_user_id(), '_hello_elementor_install_notice', 'true' );
die;
}
add_action( 'wp_ajax_hello_elementor_set_admin_notice_viewed', 'ajax_hello_elementor_set_admin_notice_viewed' );
if ( ! did_action( 'elementor/loaded' ) ) {
add_action( 'admin_notices', 'hello_elementor_fail_load_admin_notice' );
}

View File

@@ -0,0 +1,60 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
/**
* Register Customizer controls.
*
* @return void
*/
function hello_customizer_register( $wp_customize ) {
require get_template_directory() . '/includes/customizer/customizer-action-links.php';
$wp_customize->add_section(
'hello-options',
[
'title' => esc_html__( 'Header & Footer', 'hello-elementor' ),
'capability' => 'edit_theme_options',
]
);
$wp_customize->add_setting(
'hello-header-footer',
[
'sanitize_callback' => false,
'transport' => 'refresh',
]
);
$wp_customize->add_control(
new HelloElementor\Includes\Customizer\Hello_Customizer_Action_Links(
$wp_customize,
'hello-header-footer',
[
'section' => 'hello-options',
'priority' => 20,
]
)
);
}
add_action( 'customize_register', 'hello_customizer_register' );
/**
* Enqueue Customizer CSS.
*
* @return void
*/
function hello_customizer_styles() {
$min_suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
wp_enqueue_style(
'hello-elementor-customizer',
get_template_directory_uri() . '/customizer' . $min_suffix . '.css',
[],
HELLO_ELEMENTOR_VERSION
);
}
add_action( 'admin_enqueue_scripts', 'hello_customizer_styles' );

View File

@@ -0,0 +1,145 @@
<?php
namespace HelloElementor\Includes\Customizer;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
class Hello_Customizer_Action_Links extends \WP_Customize_Control {
// Whitelist content parameter
public $content = '';
/**
* Render the control's content.
*
* Allows the content to be overridden without having to rewrite the wrapper.
*
* @return void
*/
public function render_content() {
$this->print_customizer_action_links();
if ( isset( $this->description ) ) {
echo '<span class="description customize-control-description">' . wp_kses_post( $this->description ) . '</span>';
}
}
/**
* Print customizer action links.
*
* @return void
*/
private function print_customizer_action_links() {
if ( ! function_exists( 'get_plugins' ) ) {
require_once ABSPATH . 'wp-admin/includes/plugin.php';
}
$action_link_data = [];
$action_link_type = '';
$installed_plugins = get_plugins();
if ( ! isset( $installed_plugins['elementor/elementor.php'] ) ) {
$action_link_type = 'install-elementor';
} elseif ( ! defined( 'ELEMENTOR_VERSION' ) ) {
$action_link_type = 'activate-elementor';
} elseif ( ! hello_header_footer_experiment_active() ) {
$action_link_type = 'activate-header-footer-experiment';
} else {
$action_link_type = 'style-header-footer';
}
switch ( $action_link_type ) {
case 'install-elementor':
$action_link_data = [
'image' => get_template_directory_uri() . '/assets/images/elementor.svg',
'alt' => esc_attr__( 'Elementor', 'hello-elementor' ),
'title' => esc_html__( 'Install Elementor', 'hello-elementor' ),
'message' => esc_html__( 'Create cross-site header & footer using Elementor.', 'hello-elementor' ),
'button' => esc_html__( 'Install Elementor', 'hello-elementor' ),
'link' => wp_nonce_url(
add_query_arg(
[
'action' => 'install-plugin',
'plugin' => 'elementor',
],
admin_url( 'update.php' )
),
'install-plugin_elementor'
),
];
break;
case 'activate-elementor':
$action_link_data = [
'image' => get_template_directory_uri() . '/assets/images/elementor.svg',
'alt' => esc_attr__( 'Elementor', 'hello-elementor' ),
'title' => esc_html__( 'Activate Elementor', 'hello-elementor' ),
'message' => esc_html__( 'Create cross-site header & footer using Elementor.', 'hello-elementor' ),
'button' => esc_html__( 'Activate Elementor', 'hello-elementor' ),
'link' => wp_nonce_url( 'plugins.php?action=activate&plugin=elementor/elementor.php', 'activate-plugin_elementor/elementor.php' ),
];
break;
case 'activate-header-footer-experiment':
$action_link_data = [
'image' => get_template_directory_uri() . '/assets/images/elementor.svg',
'alt' => esc_attr__( 'Elementor', 'hello-elementor' ),
'title' => esc_html__( 'Style using Elementor', 'hello-elementor' ),
'message' => esc_html__( 'Design your cross-site header & footer from Elementors "Site Settings" panel.', 'hello-elementor' ),
'button' => esc_html__( 'Activate header & footer experiment', 'hello-elementor' ),
'link' => wp_nonce_url( 'admin.php?page=elementor#tab-experiments' ),
];
break;
case 'style-header-footer':
$action_link_data = [
'image' => get_template_directory_uri() . '/assets/images/elementor.svg',
'alt' => esc_attr__( 'Elementor', 'hello-elementor' ),
'title' => esc_html__( 'Style cross-site header & footer', 'hello-elementor' ),
'message' => esc_html__( 'Customize your cross-site header & footer from Elementors "Site Settings" panel.', 'hello-elementor' ),
'button' => esc_html__( 'Start Designing', 'hello-elementor' ),
'link' => wp_nonce_url( 'post.php?post=' . get_option( 'elementor_active_kit' ) . '&action=elementor' ),
];
break;
}
$customizer_content = $this->get_customizer_action_links_html( $action_link_data );
echo wp_kses_post( $customizer_content );
}
/**
* Get the customizer action links HTML.
*
* @param array $data
*
* @return string
*/
private function get_customizer_action_links_html( $data ) {
if (
empty( $data )
|| ! isset( $data['image'] )
|| ! isset( $data['alt'] )
|| ! isset( $data['title'] )
|| ! isset( $data['message'] )
|| ! isset( $data['link'] )
|| ! isset( $data['button'] )
) {
return;
}
return sprintf(
'<div class="hello-action-links">
<img src="%1$s" alt="%2$s">
<p class="hello-action-links-title">%3$s</p>
<p class="hello-action-links-message">%4$s</p>
<a class="button button-primary" target="_blank" href="%5$s">%6$s</a>
</div>',
$data['image'],
$data['alt'],
$data['title'],
$data['message'],
$data['link'],
$data['button'],
);
}
}

View File

@@ -0,0 +1,248 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
/**
* Register Site Settings Controls.
*/
add_action( 'elementor/init', 'hello_elementor_settings_init' );
function hello_elementor_settings_init() {
if ( ! hello_header_footer_experiment_active() ) {
return;
}
require 'settings/settings-header.php';
require 'settings/settings-footer.php';
add_action( 'elementor/kit/register_tabs', function( \Elementor\Core\Kits\Documents\Kit $kit ) {
if ( ! hello_elementor_display_header_footer() ) {
return;
}
$kit->register_tab( 'hello-settings-header', HelloElementor\Includes\Settings\Settings_Header::class );
$kit->register_tab( 'hello-settings-footer', HelloElementor\Includes\Settings\Settings_Footer::class );
}, 1, 40 );
}
/**
* Helper function to return a setting.
*
* Saves 2 lines to get kit, then get setting. Also caches the kit and setting.
*
* @param string $setting_id
* @return string|array same as the Elementor internal function does.
*/
function hello_elementor_get_setting( $setting_id ) {
global $hello_elementor_settings;
$return = '';
if ( ! isset( $hello_elementor_settings['kit_settings'] ) ) {
$kit = \Elementor\Plugin::$instance->kits_manager->get_active_kit();
$hello_elementor_settings['kit_settings'] = $kit->get_settings();
}
if ( isset( $hello_elementor_settings['kit_settings'][ $setting_id ] ) ) {
$return = $hello_elementor_settings['kit_settings'][ $setting_id ];
}
return apply_filters( 'hello_elementor_' . $setting_id, $return );
}
/**
* Helper function to show/hide elements
*
* This works with switches, if the setting ID that has been passed is toggled on, we'll return show, otherwise we'll return hide
*
* @param string $setting_id
* @return string|array same as the Elementor internal function does.
*/
function hello_show_or_hide( $setting_id ) {
return ( 'yes' === hello_elementor_get_setting( $setting_id ) ? 'show' : 'hide' );
}
/**
* Helper function to translate the header layout setting into a class name.
*
* @return string
*/
function hello_get_header_layout_class() {
$layout_classes = [];
$header_layout = hello_elementor_get_setting( 'hello_header_layout' );
if ( 'inverted' === $header_layout ) {
$layout_classes[] = 'header-inverted';
} elseif ( 'stacked' === $header_layout ) {
$layout_classes[] = 'header-stacked';
}
$header_width = hello_elementor_get_setting( 'hello_header_width' );
if ( 'full-width' === $header_width ) {
$layout_classes[] = 'header-full-width';
}
$header_menu_dropdown = hello_elementor_get_setting( 'hello_header_menu_dropdown' );
if ( 'tablet' === $header_menu_dropdown ) {
$layout_classes[] = 'menu-dropdown-tablet';
} elseif ( 'mobile' === $header_menu_dropdown ) {
$layout_classes[] = 'menu-dropdown-mobile';
} elseif ( 'none' === $header_menu_dropdown ) {
$layout_classes[] = 'menu-dropdown-none';
}
$hello_header_menu_layout = hello_elementor_get_setting( 'hello_header_menu_layout' );
if ( 'dropdown' === $hello_header_menu_layout ) {
$layout_classes[] = 'menu-layout-dropdown';
}
return implode( ' ', $layout_classes );
}
/**
* Helper function to translate the footer layout setting into a class name.
*
* @return string
*/
function hello_get_footer_layout_class() {
$footer_layout = hello_elementor_get_setting( 'hello_footer_layout' );
$layout_classes = [];
if ( 'inverted' === $footer_layout ) {
$layout_classes[] = 'footer-inverted';
} elseif ( 'stacked' === $footer_layout ) {
$layout_classes[] = 'footer-stacked';
}
$footer_width = hello_elementor_get_setting( 'hello_footer_width' );
if ( 'full-width' === $footer_width ) {
$layout_classes[] = 'footer-full-width';
}
if ( hello_elementor_get_setting( 'hello_footer_copyright_display' ) && '' !== hello_elementor_get_setting( 'hello_footer_copyright_text' ) ) {
$layout_classes[] = 'footer-has-copyright';
}
return implode( ' ', $layout_classes );
}
add_action( 'elementor/editor/after_enqueue_scripts', function() {
if ( ! hello_header_footer_experiment_active() ) {
return;
}
$suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
wp_enqueue_script(
'hello-theme-editor',
get_template_directory_uri() . '/assets/js/hello-editor' . $suffix . '.js',
[ 'jquery', 'elementor-editor' ],
HELLO_ELEMENTOR_VERSION,
true
);
wp_enqueue_style(
'hello-editor',
get_template_directory_uri() . '/editor' . $suffix . '.css',
[],
HELLO_ELEMENTOR_VERSION
);
} );
add_action( 'wp_enqueue_scripts', function() {
if ( ! hello_elementor_display_header_footer() ) {
return;
}
if ( ! hello_header_footer_experiment_active() ) {
return;
}
$suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
wp_enqueue_script(
'hello-theme-frontend',
get_template_directory_uri() . '/assets/js/hello-frontend' . $suffix . '.js',
[],
HELLO_ELEMENTOR_VERSION,
true
);
\Elementor\Plugin::$instance->kits_manager->frontend_before_enqueue_styles();
} );
/**
* Helper function to decide whether to output the header template.
*
* @return bool
*/
function hello_get_header_display() {
$is_editor = isset( $_GET['elementor-preview'] );
return (
$is_editor
|| hello_elementor_get_setting( 'hello_header_logo_display' )
|| hello_elementor_get_setting( 'hello_header_tagline_display' )
|| hello_elementor_get_setting( 'hello_header_menu_display' )
);
}
/**
* Helper function to decide whether to output the footer template.
*
* @return bool
*/
function hello_get_footer_display() {
$is_editor = isset( $_GET['elementor-preview'] );
return (
$is_editor
|| hello_elementor_get_setting( 'hello_footer_logo_display' )
|| hello_elementor_get_setting( 'hello_footer_tagline_display' )
|| hello_elementor_get_setting( 'hello_footer_menu_display' )
|| hello_elementor_get_setting( 'hello_footer_copyright_display' )
);
}
/**
* Add Hello Elementor theme Header & Footer to Experiments.
*/
add_action( 'elementor/experiments/default-features-registered', function( \Elementor\Core\Experiments\Manager $experiments_manager ) {
$experiments_manager->add_feature( [
'name' => 'hello-theme-header-footer',
'title' => esc_html__( 'Hello Theme Header & Footer', 'hello-elementor' ),
'description' => sprintf(
'%1$s <a href="%2$s" target="_blank">%3$s</a>',
esc_html__( 'Customize and style the builtin Hello Themes cross-site header & footer from the Elementor "Site Settings" panel.', 'hello-elementor' ),
'https://go.elementor.com/wp-dash-header-footer',
esc_html__( 'Learn More', 'hello-elementor' )
),
'release_status' => $experiments_manager::RELEASE_STATUS_STABLE,
'new_site' => [
'minimum_installation_version' => '3.3.0',
'default_active' => $experiments_manager::STATE_ACTIVE,
],
] );
} );
/**
* Helper function to check if Header & Footer Experiment is Active/Inactive
*/
function hello_header_footer_experiment_active() {
// If Elementor is not active, return false
if ( ! did_action( 'elementor/loaded' ) ) {
return false;
}
// Backwards compat.
if ( ! method_exists( \Elementor\Plugin::$instance->experiments, 'is_feature_active' ) ) {
return false;
}
return (bool) ( \Elementor\Plugin::$instance->experiments->is_feature_active( 'hello-theme-header-footer' ) );
}

View File

@@ -0,0 +1,190 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
add_action( 'admin_menu', 'hello_elementor_settings_page' );
add_action( 'init', 'hello_elementor_tweak_settings', 0 );
/**
* Register theme settings page.
*/
function hello_elementor_settings_page() {
$menu_hook = '';
$menu_hook = add_theme_page(
esc_html__( 'Hello Theme Settings', 'hello-elementor' ),
esc_html__( 'Theme Settings', 'hello-elementor' ),
'manage_options',
'hello-theme-settings',
'hello_elementor_settings_page_render'
);
add_action( 'load-' . $menu_hook, function() {
add_action( 'admin_enqueue_scripts', 'hello_elementor_settings_page_scripts', 10 );
} );
}
/**
* Register settings page scripts.
*/
function hello_elementor_settings_page_scripts() {
$dir = get_template_directory() . '/assets/js';
$suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
$handle = 'hello-admin';
$asset_path = "$dir/hello-admin.asset.php";
$asset_url = get_template_directory_uri() . '/assets/js';
if ( ! file_exists( $asset_path ) ) {
throw new \Error( 'You need to run `npm run build` for the "hello-theme" first.' );
}
$script_asset = require( $asset_path );
wp_enqueue_script(
$handle,
"$asset_url/$handle$suffix.js",
$script_asset['dependencies'],
$script_asset['version']
);
wp_set_script_translations( $handle, 'hello-elementor' );
wp_enqueue_style(
$handle,
"$asset_url/$handle$suffix.css",
[ 'wp-components' ],
$script_asset['version']
);
$plugins = get_plugins();
if ( ! isset( $plugins['elementor/elementor.php'] ) ) {
$action_link_type = 'install-elementor';
$action_link_url = wp_nonce_url(
add_query_arg(
[
'action' => 'install-plugin',
'plugin' => 'elementor',
],
admin_url( 'update.php' )
),
'install-plugin_elementor'
);
} elseif ( ! defined( 'ELEMENTOR_VERSION' ) ) {
$action_link_type = 'activate-elementor';
$action_link_url = wp_nonce_url( 'plugins.php?action=activate&plugin=elementor/elementor.php', 'activate-plugin_elementor/elementor.php' );
} elseif ( hello_header_footer_experiment_active() && ! hello_header_footer_experiment_active() ) {
$action_link_type = 'activate-header-footer-experiment';
$action_link_url = wp_nonce_url( 'admin.php?page=elementor#tab-experiments' );
} elseif ( hello_header_footer_experiment_active() ) {
$action_link_type = 'style-header-footer';
$action_link_url = wp_nonce_url( 'post.php?post=' . get_option( 'elementor_active_kit' ) . '&action=elementor' );
} else {
$action_link_type = '';
$action_link_url = '';
}
wp_localize_script(
$handle,
'helloAdminData',
[
'actionLinkType' => $action_link_type,
'actionLinkURL' => $action_link_url,
'templateDirectoryURI' => get_template_directory_uri(),
]
);
}
/**
* Render settings page wrapper element.
*/
function hello_elementor_settings_page_render() {
?>
<div id="hello-elementor-settings"></div>
<?php
}
/**
* Theme tweaks & settings.
*/
function hello_elementor_tweak_settings() {
$settings_group = 'hello_elementor_settings';
$settings = [
'DESCRIPTION_META_TAG' => '_description_meta_tag',
'SKIP_LINK' => '_skip_link',
'HEADER_FOOTER' => '_header_footer',
'PAGE_TITLE' => '_page_title',
'HELLO_STYLE' => '_hello_style',
'HELLO_THEME' => '_hello_theme',
];
hello_elementor_register_settings( $settings_group, $settings );
hello_elementor_render_tweaks( $settings_group, $settings );
}
/**
* Register theme settings.
*/
function hello_elementor_register_settings( $settings_group, $settings ) {
foreach ( $settings as $setting_key => $setting_value ) {
register_setting(
$settings_group,
$settings_group . $setting_value,
[
'default' => '',
'show_in_rest' => true,
'type' => 'string',
]
);
}
}
/**
* Run a tweek only if the user requested it.
*/
function hello_elementor_do_tweak( $setting, $tweak_callback ) {
$option = get_option( $setting );
if ( isset( $option ) && ( 'true' === $option ) && is_callable( $tweak_callback ) ) {
$tweak_callback();
}
}
/**
* Render theme tweaks.
*/
function hello_elementor_render_tweaks( $settings_group, $settings ) {
hello_elementor_do_tweak( $settings_group . $settings['DESCRIPTION_META_TAG'], function() {
remove_action( 'wp_head', 'hello_elementor_add_description_meta_tag' );
} );
hello_elementor_do_tweak( $settings_group . $settings['SKIP_LINK'], function() {
add_filter( 'hello_elementor_enable_skip_link', '__return_false' );
} );
hello_elementor_do_tweak( $settings_group . $settings['HEADER_FOOTER'], function() {
add_filter( 'hello_elementor_header_footer', '__return_false' );
} );
hello_elementor_do_tweak( $settings_group . $settings['PAGE_TITLE'], function() {
add_filter( 'hello_elementor_page_title', '__return_false' );
} );
hello_elementor_do_tweak( $settings_group . $settings['HELLO_STYLE'], function() {
add_filter( 'hello_elementor_enqueue_style', '__return_false' );
} );
hello_elementor_do_tweak( $settings_group . $settings['HELLO_THEME'], function() {
add_filter( 'hello_elementor_enqueue_theme_style', '__return_false' );
} );
}

View File

@@ -0,0 +1,532 @@
<?php
namespace HelloElementor\Includes\Settings;
use Elementor\Controls_Manager;
use Elementor\Group_Control_Background;
use Elementor\Group_Control_Typography;
use Elementor\Core\Kits\Documents\Tabs\Tab_Base;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}
class Settings_Footer extends Tab_Base {
public function get_id() {
return 'hello-settings-footer';
}
public function get_title() {
return esc_html__( 'Hello Theme Footer', 'hello-elementor' );
}
public function get_icon() {
return 'eicon-footer';
}
public function get_help_url() {
return '';
}
public function get_group() {
return 'theme-style';
}
protected function register_tab_controls() {
$this->start_controls_section(
'hello_footer_section',
[
'tab' => 'hello-settings-footer',
'label' => esc_html__( 'Footer', 'hello-elementor' ),
]
);
$this->add_control(
'hello_footer_logo_display',
[
'type' => Controls_Manager::SWITCHER,
'label' => esc_html__( 'Site Logo', 'hello-elementor' ),
'default' => 'yes',
'label_on' => esc_html__( 'Show', 'hello-elementor' ),
'label_off' => esc_html__( 'Hide', 'hello-elementor' ),
'selector' => '.site-footer .site-branding',
]
);
$this->add_control(
'hello_footer_tagline_display',
[
'type' => Controls_Manager::SWITCHER,
'label' => esc_html__( 'Tagline', 'hello-elementor' ),
'default' => 'yes',
'label_on' => esc_html__( 'Show', 'hello-elementor' ),
'label_off' => esc_html__( 'Hide', 'hello-elementor' ),
'selector' => '.site-footer .site-description',
]
);
$this->add_control(
'hello_footer_menu_display',
[
'type' => Controls_Manager::SWITCHER,
'label' => esc_html__( 'Menu', 'hello-elementor' ),
'default' => 'yes',
'label_on' => esc_html__( 'Show', 'hello-elementor' ),
'label_off' => esc_html__( 'Hide', 'hello-elementor' ),
'selector' => '.site-footer .site-navigation',
]
);
$this->add_control(
'hello_footer_copyright_display',
[
'type' => Controls_Manager::SWITCHER,
'label' => esc_html__( 'Copyright', 'hello-elementor' ),
'default' => 'yes',
'label_on' => esc_html__( 'Show', 'hello-elementor' ),
'label_off' => esc_html__( 'Hide', 'hello-elementor' ),
'selector' => '.site-footer .copyright',
]
);
$this->add_control(
'hello_footer_disable_note',
[
'type' => Controls_Manager::RAW_HTML,
'raw' => sprintf(
/* translators: %s: Link that opens the theme settings page. */
__( 'Note: Hiding all the elements, only hides them visually. To disable them completely go to <a href="%s">Theme Settings</a> .', 'hello-elementor' ),
admin_url( 'themes.php?page=hello-theme-settings' )
),
'content_classes' => 'elementor-panel-alert elementor-panel-alert-warning',
'condition' => [
'hello_footer_logo_display' => '',
'hello_footer_tagline_display' => '',
'hello_footer_menu_display' => '',
'hello_footer_copyright_display' => '',
],
]
);
$this->add_control(
'hello_footer_layout',
[
'type' => Controls_Manager::SELECT,
'label' => esc_html__( 'Layout', 'hello-elementor' ),
'options' => [
'default' => esc_html__( 'Default', 'hello-elementor' ),
'inverted' => esc_html__( 'Inverted', 'hello-elementor' ),
'stacked' => esc_html__( 'Centered', 'hello-elementor' ),
],
'selector' => '.site-footer',
'default' => 'default',
'separator' => 'before',
]
);
$this->add_control(
'hello_footer_width',
[
'type' => Controls_Manager::SELECT,
'label' => esc_html__( 'Width', 'hello-elementor' ),
'options' => [
'boxed' => esc_html__( 'Boxed', 'hello-elementor' ),
'full-width' => esc_html__( 'Full Width', 'hello-elementor' ),
],
'selector' => '.site-footer',
'default' => 'boxed',
]
);
$this->add_responsive_control(
'hello_footer_custom_width',
[
'type' => Controls_Manager::SLIDER,
'label' => esc_html__( 'Content Width', 'hello-elementor' ),
'size_units' => [ '%', 'px', 'em', 'rem', 'vw', 'custom' ],
'range' => [
'px' => [
'max' => 2000,
],
'em' => [
'max' => 100,
],
'rem' => [
'max' => 100,
],
],
'condition' => [
'hello_footer_width' => 'boxed',
],
'selectors' => [
'.site-footer .footer-inner' => 'width: {{SIZE}}{{UNIT}}; max-width: 100%;',
],
]
);
$this->add_responsive_control(
'hello_footer_gap',
[
'type' => Controls_Manager::SLIDER,
'label' => esc_html__( 'Gap', 'hello-elementor' ),
'size_units' => [ '%', 'px', 'em ', 'rem', 'vw', 'custom' ],
'range' => [
'px' => [
'max' => 100,
],
'em' => [
'max' => 5,
],
'rem' => [
'max' => 5,
],
],
'selectors' => [
'.site-footer' => 'padding-inline-end: {{SIZE}}{{UNIT}}; padding-inline-start: {{SIZE}}{{UNIT}}',
],
'condition' => [
'hello_footer_layout!' => 'stacked',
],
]
);
$this->add_group_control(
Group_Control_Background::get_type(),
[
'name' => 'hello_footer_background',
'label' => esc_html__( 'Background', 'hello-elementor' ),
'types' => [ 'classic', 'gradient' ],
'selector' => '.site-footer',
]
);
$this->end_controls_section();
$this->start_controls_section(
'hello_footer_logo_section',
[
'tab' => 'hello-settings-footer',
'label' => esc_html__( 'Site Logo', 'hello-elementor' ),
'condition' => [
'hello_footer_logo_display!' => '',
],
]
);
$this->add_control(
'hello_footer_logo_type',
[
'label' => esc_html__( 'Type', 'hello-elementor' ),
'type' => Controls_Manager::SELECT,
'default' => 'logo',
'options' => [
'logo' => esc_html__( 'Logo', 'hello-elementor' ),
'title' => esc_html__( 'Title', 'hello-elementor' ),
],
'frontend_available' => true,
]
);
$this->add_responsive_control(
'hello_footer_logo_width',
[
'type' => Controls_Manager::SLIDER,
'label' => esc_html__( 'Logo Width', 'hello-elementor' ),
'description' => sprintf(
/* translators: %s: Link that opens Elementor's "Site Identity" panel. */
__( 'Go to <a href="%s">Site Identity</a> to manage your site\'s logo', 'hello-elementor' ),
"javascript:\$e.route('panel/global/settings-site-identity')"
),
'size_units' => [ '%', 'px', 'em', 'rem', 'vw', 'custom' ],
'range' => [
'px' => [
'max' => 1000,
],
'em' => [
'max' => 100,
],
'rem' => [
'max' => 100,
],
],
'condition' => [
'hello_footer_logo_display' => 'yes',
'hello_footer_logo_type' => 'logo',
],
'selectors' => [
'.site-footer .site-branding .site-logo img' => 'width: {{SIZE}}{{UNIT}}; max-width: {{SIZE}}{{UNIT}}',
],
]
);
$this->add_control(
'hello_footer_title_color',
[
'label' => esc_html__( 'Text Color', 'hello-elementor' ),
'type' => Controls_Manager::COLOR,
'condition' => [
'hello_footer_logo_display' => 'yes',
'hello_footer_logo_type' => 'title',
],
'selectors' => [
'.site-footer h4.site-title a' => 'color: {{VALUE}};',
],
]
);
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'name' => 'hello_footer_title_typography',
'label' => esc_html__( 'Typography', 'hello-elementor' ),
'condition' => [
'hello_footer_logo_display' => 'yes',
'hello_footer_logo_type' => 'title',
],
'selector' => '.site-footer h4.site-title',
]
);
$this->add_control(
'hello_footer_title_link',
[
'type' => Controls_Manager::RAW_HTML,
'raw' => sprintf(
/* translators: %s: Link that opens Elementor's "Site Identity" panel. */
__( 'Go to <a href="%s">Site Identity</a> to manage your site\'s title', 'hello-elementor' ),
"javascript:\$e.route('panel/global/settings-site-identity')"
),
'content_classes' => 'elementor-control-field-description',
'condition' => [
'hello_footer_logo_display' => 'yes',
'hello_footer_logo_type' => 'title',
],
]
);
$this->end_controls_section();
$this->start_controls_section(
'hello_footer_tagline',
[
'tab' => 'hello-settings-footer',
'label' => esc_html__( 'Tagline', 'hello-elementor' ),
'condition' => [
'hello_footer_tagline_display' => 'yes',
],
]
);
$this->add_control(
'hello_footer_tagline_color',
[
'label' => esc_html__( 'Text Color', 'hello-elementor' ),
'type' => Controls_Manager::COLOR,
'condition' => [
'hello_footer_tagline_display' => 'yes',
],
'selectors' => [
'.site-footer .site-description' => 'color: {{VALUE}};',
],
]
);
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'name' => 'hello_footer_tagline_typography',
'label' => esc_html__( 'Typography', 'hello-elementor' ),
'condition' => [
'hello_footer_tagline_display' => 'yes',
],
'selector' => '.site-footer .site-description',
]
);
$this->add_control(
'hello_footer_tagline_link',
[
'type' => Controls_Manager::RAW_HTML,
'raw' => sprintf(
/* translators: %s: Link that opens Elementor's "Site Identity" panel. */
__( 'Go to <a href="%s">Site Identity</a> to manage your site\'s tagline', 'hello-elementor' ),
"javascript:\$e.route('panel/global/settings-site-identity')"
),
'content_classes' => 'elementor-control-field-description',
]
);
$this->end_controls_section();
$this->start_controls_section(
'hello_footer_menu_tab',
[
'tab' => 'hello-settings-footer',
'label' => esc_html__( 'Menu', 'hello-elementor' ),
'condition' => [
'hello_footer_menu_display' => 'yes',
],
]
);
$available_menus = wp_get_nav_menus();
$menus = [ '0' => esc_html__( '— Select a Menu —', 'hello-elementor' ) ];
foreach ( $available_menus as $available_menu ) {
$menus[ $available_menu->term_id ] = $available_menu->name;
}
if ( 1 === count( $menus ) ) {
$this->add_control(
'hello_footer_menu_notice',
[
'type' => Controls_Manager::RAW_HTML,
'raw' => '<strong>' . esc_html__( 'There are no menus in your site.', 'hello-elementor' ) . '</strong><br>' . sprintf( __( 'Go to <a href="%s" target="_blank">Menus screen</a> to create one.', 'hello-elementor' ), admin_url( 'nav-menus.php?action=edit&menu=0' ) ),
'separator' => 'after',
'content_classes' => 'elementor-panel-alert elementor-panel-alert-info',
]
);
} else {
$this->add_control(
'hello_footer_menu',
[
'label' => esc_html__( 'Menu', 'hello-elementor' ),
'type' => Controls_Manager::SELECT,
'options' => $menus,
'default' => array_keys( $menus )[0],
'description' => sprintf( __( 'Go to the <a href="%s" target="_blank">Menus screen</a> to manage your menus.', 'hello-elementor' ), admin_url( 'nav-menus.php' ) ),
]
);
$this->add_control(
'hello_footer_menu_warning',
[
'type' => Controls_Manager::RAW_HTML,
'raw' => esc_html__( 'Changes will be reflected in the preview only after the page reloads.', 'hello-elementor' ),
'content_classes' => 'elementor-panel-alert elementor-panel-alert-info',
]
);
$this->add_control(
'hello_footer_menu_color',
[
'label' => esc_html__( 'Color', 'hello-elementor' ),
'type' => Controls_Manager::COLOR,
'selectors' => [
'footer .footer-inner .site-navigation a' => 'color: {{VALUE}};',
],
]
);
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'name' => 'hello_footer_menu_typography',
'label' => esc_html__( 'Typography', 'hello-elementor' ),
'selector' => 'footer .footer-inner .site-navigation a',
]
);
}
$this->end_controls_section();
$this->start_controls_section(
'hello_footer_copyright_section',
[
'tab' => 'hello-settings-footer',
'label' => esc_html__( 'Copyright', 'hello-elementor' ),
'conditions' => [
'relation' => 'and',
'terms' => [
[
'name' => 'hello_footer_copyright_display',
'operator' => '=',
'value' => 'yes',
],
],
],
]
);
$this->add_control(
'hello_footer_copyright_text',
[
'type' => Controls_Manager::TEXTAREA,
'default' => esc_html__( 'All rights reserved', 'hello-elementor' ),
]
);
$this->add_control(
'hello_footer_copyright_color',
[
'label' => esc_html__( 'Text Color', 'hello-elementor' ),
'type' => Controls_Manager::COLOR,
'condition' => [
'hello_footer_copyright_display' => 'yes',
],
'selectors' => [
'.site-footer .copyright p' => 'color: {{VALUE}};',
],
]
);
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'name' => 'hello_footer_copyright_typography',
'label' => esc_html__( 'Typography', 'hello-elementor' ),
'condition' => [
'hello_footer_copyright_display' => 'yes',
],
'selector' => '.site-footer .copyright p',
]
);
$this->end_controls_section();
}
public function on_save( $data ) {
// Save chosen footer menu to the WP settings.
if ( isset( $data['settings']['hello_footer_menu'] ) ) {
$menu_id = $data['settings']['hello_footer_menu'];
$locations = get_theme_mod( 'nav_menu_locations' );
$locations['menu-2'] = (int) $menu_id;
set_theme_mod( 'nav_menu_locations', $locations );
}
}
public function get_additional_tab_content() {
$content_template = '
<div class="hello-elementor elementor-nerd-box">
<img src="%1$s" class="elementor-nerd-box-icon" alt="%2$s">
<p class="elementor-nerd-box-title">%3$s</p>
<p class="elementor-nerd-box-message">%4$s</p>
<a class="elementor-nerd-box-link elementor-button" target="_blank" href="%5$s">%6$s</a>
</div>';
if ( ! defined( 'ELEMENTOR_PRO_VERSION' ) ) {
return sprintf(
$content_template,
get_template_directory_uri() . '/assets/images/go-pro.svg',
esc_attr__( 'Get Elementor Pro', 'hello-elementor' ),
esc_html__( 'Create a custom footer with multiple options', 'hello-elementor' ),
esc_html__( 'Upgrade to Elementor Pro and enjoy free design and many more features', 'hello-elementor' ),
'https://go.elementor.com/hello-theme-footer/',
esc_html__( 'Upgrade', 'hello-elementor' )
);
} else {
return sprintf(
$content_template,
get_template_directory_uri() . '/assets/images/go-pro.svg',
esc_attr__( 'Elementor Pro', 'hello-elementor' ),
esc_html__( 'Create a custom footer with the Theme Builder', 'hello-elementor' ),
esc_html__( 'With the Theme Builder you can jump directly into each part of your site', 'hello-elementor' ),
get_admin_url( null, 'admin.php?page=elementor-app#/site-editor/templates/footer' ),
esc_html__( 'Create Footer', 'hello-elementor' )
);
}
}
}

View File

@@ -0,0 +1,554 @@
<?php
namespace HelloElementor\Includes\Settings;
use Elementor\Plugin;
use Elementor\Controls_Manager;
use Elementor\Group_Control_Background;
use Elementor\Group_Control_Typography;
use Elementor\Core\Responsive\Responsive;
use Elementor\Core\Kits\Documents\Tabs\Tab_Base;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}
class Settings_Header extends Tab_Base {
public function get_id() {
return 'hello-settings-header';
}
public function get_title() {
return esc_html__( 'Hello Theme Header', 'hello-elementor' );
}
public function get_icon() {
return 'eicon-header';
}
public function get_help_url() {
return '';
}
public function get_group() {
return 'theme-style';
}
protected function register_tab_controls() {
$this->start_controls_section(
'hello_header_section',
[
'tab' => 'hello-settings-header',
'label' => esc_html__( 'Header', 'hello-elementor' ),
]
);
$this->add_control(
'hello_header_logo_display',
[
'type' => Controls_Manager::SWITCHER,
'label' => esc_html__( 'Site Logo', 'hello-elementor' ),
'default' => 'yes',
'label_on' => esc_html__( 'Show', 'hello-elementor' ),
'label_off' => esc_html__( 'Hide', 'hello-elementor' ),
]
);
$this->add_control(
'hello_header_tagline_display',
[
'type' => Controls_Manager::SWITCHER,
'label' => esc_html__( 'Tagline', 'hello-elementor' ),
'default' => 'yes',
'label_on' => esc_html__( 'Show', 'hello-elementor' ),
'label_off' => esc_html__( 'Hide', 'hello-elementor' ),
]
);
$this->add_control(
'hello_header_menu_display',
[
'type' => Controls_Manager::SWITCHER,
'label' => esc_html__( 'Menu', 'hello-elementor' ),
'default' => 'yes',
'label_on' => esc_html__( 'Show', 'hello-elementor' ),
'label_off' => esc_html__( 'Hide', 'hello-elementor' ),
]
);
$this->add_control(
'hello_header_disable_note',
[
'type' => Controls_Manager::RAW_HTML,
'raw' => sprintf(
/* translators: %s: Link that opens the theme settings page. */
__( 'Note: Hiding all the elements, only hides them visually. To disable them completely go to <a href="%s">Theme Settings</a> .', 'hello-elementor' ),
admin_url( 'themes.php?page=hello-theme-settings' )
),
'content_classes' => 'elementor-panel-alert elementor-panel-alert-warning',
'condition' => [
'hello_header_logo_display' => '',
'hello_header_tagline_display' => '',
'hello_header_menu_display' => '',
],
]
);
$this->add_control(
'hello_header_layout',
[
'type' => Controls_Manager::SELECT,
'label' => esc_html__( 'Layout', 'hello-elementor' ),
'options' => [
'default' => esc_html__( 'Default', 'hello-elementor' ),
'inverted' => esc_html__( 'Inverted', 'hello-elementor' ),
'stacked' => esc_html__( 'Centered', 'hello-elementor' ),
],
'selector' => '.site-header',
'default' => 'default',
'separator' => 'before',
]
);
$this->add_control(
'hello_header_width',
[
'type' => Controls_Manager::SELECT,
'label' => esc_html__( 'Width', 'hello-elementor' ),
'options' => [
'boxed' => esc_html__( 'Boxed', 'hello-elementor' ),
'full-width' => esc_html__( 'Full Width', 'hello-elementor' ),
],
'selector' => '.site-header',
'default' => 'boxed',
]
);
$this->add_responsive_control(
'hello_header_custom_width',
[
'type' => Controls_Manager::SLIDER,
'label' => esc_html__( 'Content Width', 'hello-elementor' ),
'size_units' => [ '%', 'px', 'em', 'rem', 'vw', 'custom' ],
'range' => [
'px' => [
'max' => 2000,
],
'em' => [
'max' => 100,
],
'rem' => [
'max' => 100,
],
],
'condition' => [
'hello_header_width' => 'boxed',
],
'selectors' => [
'.site-header .header-inner' => 'width: {{SIZE}}{{UNIT}}; max-width: 100%;',
],
]
);
$this->add_responsive_control(
'hello_header_gap',
[
'type' => Controls_Manager::SLIDER,
'label' => esc_html__( 'Gap', 'hello-elementor' ),
'size_units' => [ '%', 'px', 'em ', 'rem', 'vw', 'custom' ],
'default' => [
'size' => '0',
],
'range' => [
'px' => [
'max' => 100,
],
'em' => [
'max' => 5,
],
'rem' => [
'max' => 5,
],
],
'selectors' => [
'.site-header' => 'padding-inline-end: {{SIZE}}{{UNIT}}; padding-inline-start: {{SIZE}}{{UNIT}}',
],
'conditions' => [
'relation' => 'and',
'terms' => [
[
'name' => 'hello_header_layout',
'operator' => '!=',
'value' => 'stacked',
],
],
],
]
);
$this->add_group_control(
Group_Control_Background::get_type(),
[
'name' => 'hello_header_background',
'label' => esc_html__( 'Background', 'hello-elementor' ),
'types' => [ 'classic', 'gradient' ],
'selector' => '.site-header',
]
);
$this->end_controls_section();
$this->start_controls_section(
'hello_header_logo_section',
[
'tab' => 'hello-settings-header',
'label' => esc_html__( 'Site Logo', 'hello-elementor' ),
'conditions' => [
'relation' => 'and',
'terms' => [
[
'name' => 'hello_header_logo_display',
'operator' => '=',
'value' => 'yes',
],
],
],
]
);
$this->add_control(
'hello_header_logo_type',
[
'label' => esc_html__( 'Type', 'hello-elementor' ),
'type' => Controls_Manager::SELECT,
'default' => ( has_custom_logo() ? 'logo' : 'title' ),
'options' => [
'logo' => esc_html__( 'Logo', 'hello-elementor' ),
'title' => esc_html__( 'Title', 'hello-elementor' ),
],
'frontend_available' => true,
]
);
$this->add_responsive_control(
'hello_header_logo_width',
[
'type' => Controls_Manager::SLIDER,
'label' => esc_html__( 'Logo Width', 'hello-elementor' ),
'description' => sprintf(
/* translators: %s: Link that opens Elementor's "Site Identity" panel. */
__( 'Go to <a href="%s">Site Identity</a> to manage your site\'s logo', 'hello-elementor' ),
"javascript:\$e.route('panel/global/settings-site-identity')"
),
'size_units' => [ '%', 'px', 'em', 'rem', 'vw', 'custom' ],
'range' => [
'px' => [
'max' => 1000,
],
'em' => [
'max' => 100,
],
'rem' => [
'max' => 100,
],
],
'condition' => [
'hello_header_logo_display' => 'yes',
'hello_header_logo_type' => 'logo',
],
'selectors' => [
'.site-header .site-branding .site-logo img' => 'width: {{SIZE}}{{UNIT}}; max-width: {{SIZE}}{{UNIT}}',
],
]
);
$this->add_control(
'hello_header_title_color',
[
'label' => esc_html__( 'Text Color', 'hello-elementor' ),
'type' => Controls_Manager::COLOR,
'condition' => [
'hello_header_logo_display' => 'yes',
'hello_header_logo_type' => 'title',
],
'selectors' => [
'.site-header h1.site-title a' => 'color: {{VALUE}};',
],
]
);
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'name' => 'hello_header_title_typography',
'label' => esc_html__( 'Typography', 'hello-elementor' ),
'description' => sprintf(
/* translators: %s: Link that opens Elementor's "Site Identity" panel. */
__( 'Go to <a href="%s">Site Identity</a> to manage your site\'s title', 'hello-elementor' ),
"javascript:\$e.route('panel/global/settings-site-identity')"
),
'condition' => [
'hello_header_logo_display' => 'yes',
'hello_header_logo_type' => 'title',
],
'selector' => '.site-header h1.site-title',
]
);
$this->add_control(
'hello_header_title_link',
[
'type' => Controls_Manager::RAW_HTML,
'raw' => sprintf(
/* translators: %s: Link that opens Elementor's "Site Identity" panel. */
__( 'Go to <a href="%s">Site Identity</a> to manage your site\'s title', 'hello-elementor' ),
"javascript:\$e.route('panel/global/settings-site-identity')"
),
'content_classes' => 'elementor-control-field-description',
'condition' => [
'hello_header_logo_display' => 'yes',
'hello_header_logo_type' => 'title',
],
]
);
$this->end_controls_section();
$this->start_controls_section(
'hello_header_tagline',
[
'tab' => 'hello-settings-header',
'label' => esc_html__( 'Tagline', 'hello-elementor' ),
'conditions' => [
'relation' => 'and',
'terms' => [
[
'name' => 'hello_header_tagline_display',
'operator' => '=',
'value' => 'yes',
],
],
],
]
);
$this->add_control(
'hello_header_tagline_color',
[
'label' => esc_html__( 'Text Color', 'hello-elementor' ),
'type' => Controls_Manager::COLOR,
'condition' => [
'hello_header_tagline_display' => 'yes',
],
'selectors' => [
'.site-header .site-description' => 'color: {{VALUE}};',
],
]
);
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'name' => 'hello_header_tagline_typography',
'label' => esc_html__( 'Typography', 'hello-elementor' ),
'condition' => [
'hello_header_tagline_display' => 'yes',
],
'selector' => '.site-header .site-description',
]
);
$this->add_control(
'hello_header_tagline_link',
[
'type' => Controls_Manager::RAW_HTML,
'raw' => sprintf(
/* translators: %s: Link that opens Elementor's "Site Identity" panel. */
__( 'Go to <a href="%s">Site Identity</a> to manage your site\'s tagline', 'hello-elementor' ),
"javascript:\$e.route('panel/global/settings-site-identity')"
),
'content_classes' => 'elementor-control-field-description',
]
);
$this->end_controls_section();
$this->start_controls_section(
'hello_header_menu_tab',
[
'tab' => 'hello-settings-header',
'label' => esc_html__( 'Menu', 'hello-elementor' ),
'conditions' => [
'relation' => 'and',
'terms' => [
[
'name' => 'hello_header_menu_display',
'operator' => '=',
'value' => 'yes',
],
],
],
]
);
$available_menus = wp_get_nav_menus();
$menus = [ '0' => esc_html__( '— Select a Menu —', 'hello-elementor' ) ];
foreach ( $available_menus as $available_menu ) {
$menus[ $available_menu->term_id ] = $available_menu->name;
}
if ( 1 === count( $menus ) ) {
$this->add_control(
'hello_header_menu_notice',
[
'type' => Controls_Manager::RAW_HTML,
'raw' => '<strong>' . esc_html__( 'There are no menus in your site.', 'hello-elementor' ) . '</strong><br>' . sprintf( __( 'Go to <a href="%s" target="_blank">Menus screen</a> to create one.', 'hello-elementor' ), admin_url( 'nav-menus.php?action=edit&menu=0' ) ),
'separator' => 'after',
'content_classes' => 'elementor-panel-alert elementor-panel-alert-info',
]
);
} else {
$this->add_control(
'hello_header_menu',
[
'label' => esc_html__( 'Menu', 'hello-elementor' ),
'type' => Controls_Manager::SELECT,
'options' => $menus,
'default' => array_keys( $menus )[0],
'description' => sprintf( __( 'Go to the <a href="%s" target="_blank">Menus screen</a> to manage your menus.', 'hello-elementor' ), admin_url( 'nav-menus.php' ) ),
]
);
$this->add_control(
'hello_header_menu_warning',
[
'type' => Controls_Manager::RAW_HTML,
'raw' => esc_html__( 'Changes will be reflected in the preview only after the page reloads.', 'hello-elementor' ),
'content_classes' => 'elementor-panel-alert elementor-panel-alert-info',
]
);
$this->add_control(
'hello_header_menu_layout',
[
'label' => esc_html__( 'Menu Layout', 'hello-elementor' ),
'type' => Controls_Manager::SELECT,
'default' => 'horizontal',
'options' => [
'horizontal' => esc_html__( 'Horizontal', 'hello-elementor' ),
'dropdown' => esc_html__( 'Dropdown', 'hello-elementor' ),
],
'frontend_available' => true,
]
);
$breakpoints = Responsive::get_breakpoints();
$this->add_control(
'hello_header_menu_dropdown',
[
'label' => esc_html__( 'Breakpoint', 'hello-elementor' ),
'type' => Controls_Manager::SELECT,
'default' => 'tablet',
'options' => [
/* translators: %d: Breakpoint number. */
'mobile' => sprintf( esc_html__( 'Mobile (< %dpx)', 'hello-elementor' ), $breakpoints['md'] ),
/* translators: %d: Breakpoint number. */
'tablet' => sprintf( esc_html__( 'Tablet (< %dpx)', 'hello-elementor' ), $breakpoints['lg'] ),
'none' => esc_html__( 'None', 'hello-elementor' ),
],
'selector' => '.site-header',
'condition' => [
'hello_header_menu_layout!' => 'dropdown',
],
]
);
$this->add_control(
'hello_header_menu_color',
[
'label' => esc_html__( 'Color', 'hello-elementor' ),
'type' => Controls_Manager::COLOR,
'condition' => [
'hello_header_menu_display' => 'yes',
],
'selectors' => [
'.site-header .site-navigation ul.menu li a' => 'color: {{VALUE}};',
],
]
);
$this->add_control(
'hello_header_menu_toggle_color',
[
'label' => esc_html__( 'Toggle Color', 'hello-elementor' ),
'type' => Controls_Manager::COLOR,
'condition' => [
'hello_header_menu_display' => 'yes',
],
'selectors' => [
'.site-header .site-navigation-toggle i' => 'color: {{VALUE}};',
],
]
);
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'name' => 'hello_header_menu_typography',
'label' => esc_html__( 'Typography', 'hello-elementor' ),
'condition' => [
'hello_header_menu_display' => 'yes',
],
'selector' => '.site-header .site-navigation .menu li',
]
);
}
$this->end_controls_section();
}
public function on_save( $data ) {
// Save chosen header menu to the WP settings.
if ( isset( $data['settings']['hello_header_menu'] ) ) {
$menu_id = $data['settings']['hello_header_menu'];
$locations = get_theme_mod( 'nav_menu_locations' );
$locations['menu-1'] = (int) $menu_id;
set_theme_mod( 'nav_menu_locations', $locations );
}
}
public function get_additional_tab_content() {
$content_template = '
<div class="hello-elementor elementor-nerd-box">
<img src="%1$s" class="elementor-nerd-box-icon" alt="%2$s">
<p class="elementor-nerd-box-title">%3$s</p>
<p class="elementor-nerd-box-message">%4$s</p>
<a class="elementor-nerd-box-link elementor-button" target="_blank" href="%5$s">%6$s</a>
</div>';
if ( ! defined( 'ELEMENTOR_PRO_VERSION' ) ) {
return sprintf(
$content_template,
get_template_directory_uri() . '/assets/images/go-pro.svg',
esc_attr__( 'Get Elementor Pro', 'hello-elementor' ),
esc_html__( 'Create a custom header with multiple options', 'hello-elementor' ),
esc_html__( 'Upgrade to Elementor Pro and enjoy free design and many more features', 'hello-elementor' ),
'https://go.elementor.com/hello-theme-header/',
esc_html__( 'Upgrade', 'hello-elementor' )
);
} else {
return sprintf(
$content_template,
get_template_directory_uri() . '/assets/images/go-pro.svg',
esc_attr__( 'Elementor Pro', 'hello-elementor' ),
esc_html__( 'Create a custom header with the Theme Builder', 'hello-elementor' ),
esc_html__( 'With the Theme Builder you can jump directly into each part of your site', 'hello-elementor' ),
get_admin_url( null, 'admin.php?page=elementor-app#/site-editor/templates/header' ),
esc_html__( 'Create Header', 'hello-elementor' )
);
}
}
}

View File

@@ -0,0 +1,37 @@
<?php
/**
* The site's entry point.
*
* Loads the relevant template part,
* the loop is executed (when needed) by the relevant template part.
*
* @package HelloElementor
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
get_header();
$is_elementor_theme_exist = function_exists( 'elementor_theme_do_location' );
if ( is_singular() ) {
if ( ! $is_elementor_theme_exist || ! elementor_theme_do_location( 'single' ) ) {
get_template_part( 'template-parts/single' );
}
} elseif ( is_archive() || is_home() ) {
if ( ! $is_elementor_theme_exist || ! elementor_theme_do_location( 'archive' ) ) {
get_template_part( 'template-parts/archive' );
}
} elseif ( is_search() ) {
if ( ! $is_elementor_theme_exist || ! elementor_theme_do_location( 'archive' ) ) {
get_template_part( 'template-parts/search' );
}
} else {
if ( ! $is_elementor_theme_exist || ! elementor_theme_do_location( 'single' ) ) {
get_template_part( 'template-parts/404' );
}
}
get_footer();

View File

@@ -0,0 +1,254 @@
=== Hello Elementor ===
Contributors: elemntor, KingYes, ariel.k, bainternet
Requires at least: 6.0
Tested up to: 6.4
Stable tag: 3.0.1
Version: 3.0.1
Requires PHP: 7.3
License: GNU General Public License v3 or later
License URI: https://www.gnu.org/licenses/gpl-3.0.html
A lightweight and minimalist WordPress theme for Elementor site builder.
== Description ==
Hello Elementor is a lightweight and minimalist WordPress theme that was built specifically to work seamlessly with the Elementor site builder plugin. The theme is free, open-source, and designed for users who want a flexible, easy-to-use, and customizable website.
The theme's main focus is on providing a solid foundation for users to build their own unique designs using the Elementor drag-and-drop site builder. It is optimized for speed and performance, and its simplicity and flexibility make it a great choice for both beginners and experienced website designers.
The theme supports common WordPress features which can be extended using a child-theme. In addition, there are several ways to add custom styles. It can be done from **Elementor**, using a child-theme, or with an external plugin. To customize the theme further, visit [Elementor developers docs](https://developers.elementor.com/docs/hello-elementor-theme/).
== Copyright ==
This theme, like WordPress, is distributed under the terms of GPL.
Use it as your springboard to building a site with ***Elementor***.
Hello Elementor bundles the following third-party resources:
Font Awesome icons for theme screenshot
License: SIL Open Font License, version 1.1.
Source: https://fontawesome.com/v4.7.0/
Image for theme screenshot, Copyright Jason Blackeye
License: CC0 1.0 Universal (CC0 1.0)
Source: https://stocksnap.io/photo/4B83RD7BV9
== Changelog ==
= 3.0.1 - 2024-01-24 =
* Fix: Harden security for admin notice dismiss button
* Fix: Add `alt` attribute to all the images in the dashboard
= 3.0.0 - 2023-12-26 =
* New: Option to disable cross-site header & footer
* Tweak: Update `Requires PHP 7.3`
* Tweak: Update `Tested up to 6.4`
* Tweak: Move cross-site header & footer styles to a separate CSS file
* Tweak: Don't load `header-footer.min.css` when disabling header & footer
* Tweak: Don't load `hello-frontend.min.js` when disabling header & footer
* Tweak: Replace jQuery code with vanilla JS in the frontend
* Tweak: Replace jQuery code with vanilla JS in WordPress admin
* Tweak: Remove unused JS code from the frontend
* Tweak: Remove unused CSS code from the editor
* Tweak: Remove unnecessary `role` attributes from HTML landmark elements
* Tweak: Link from Elementor Site Settings to Hello Theme Settings
* Fix: Dynamic script version for better caching
= 2.9.0 - 2023-10-25 =
* New: Introducing the new settings page for the theme
* New: Option to disable description meta tag
* New: Option to disable skip link
* New: Option to disable page title
* New: Option to unregister Hello style.css
* New: Option to unregister Hello theme.css
* Tweak: Update `Requires at least 6.0`
* Tweak: Update `Tested up to 6.3`
= 2.8.1 - 2023-07-05 =
* Tweak: Added additional CSS selectors to apply RTL on comments
* Fix: Comment area style regression
= 2.8.0 - 2023-07-04 =
* Tweak: Update `Requires PHP 7.0`
* Tweak: Added description meta tag with excerpt text
* Tweak: Use CSS logical properties rather than physical properties
* Tweak: Replace legacy `page-break-*` CSS properties with `break-*` properties
* Tweak: Remove duplicate CSS classes for screen readers
* Tweak: Merge similar translation strings (i18n)
= 2.7.1 - 2023-03-27 =
* Tweak: Add excerpt support for pages
* Tweak: When post comments are closed, display it to the user
* Fix: Empty "Skip to content" href ([#276](https://github.com/elementor/hello-theme/issues/276))
* Fix: Child themes using `hello_elementor_body_open()` no longer working ([#278](https://github.com/elementor/hello-theme/issues/278))
= 2.7.0 - 2023-03-26 =
* Tweak: Update `Requires at least 5.9`
* Tweak: Update `Tested up to 6.2`
* Tweak: Remove backwards compatibility support for `wp_body_open()`
* Tweak: Match `search.php` markup to `archive.php` markup
* Tweak: Check if posts have featured images set
* Tweak: Remove unnecessary `role` attributes from HTML landmark elements
* Tweak: Escape translation strings for secure HTML output
* Tweak: Use i18n function to make the "Menu" string translatable
* Tweak: Minify SVG assets
* Tweak: Make header nav-menu keyboard accessible
* Tweak: Add `role="button"` to the nav-menu toggle for better accessibility
* Tweak: Toggle mobile nav-menu with `Enter` & `Space` keyboard keys
* Tweak: Add `hello_elementor_enable_skip_link` filter to enable/disable the skip link
* Tweak: Add `hello_elementor_skip_link_url` filter to change skip link URL
* Tweak: Use theme CSS not Elementor plugins CSS
* Tweak: Added support for the new Elementor version
* Tweak: Update autoprefixer to exclude dead browsers
* Tweak: Delete deprecated `elementor_hello_theme_load_textdomain` filter hook
* Tweak: Delete deprecated `elementor_hello_theme_register_menus` filter hook
* Tweak: Delete deprecated `elementor_hello_theme_add_theme_support` filter hook
* Tweak: Delete deprecated `elementor_hello_theme_add_woocommerce_support` filter hook
* Tweak: Delete deprecated `elementor_hello_theme_enqueue_style` filter hook
* Tweak: Delete deprecated `elementor_hello_theme_register_elementor_locations` filter hook
* Tweak: Added additional and `custom` units to header & footer panels
* Tweak: Link to Elementor "Site Identity" panel from the header & footer panels
* Tweak: Delete the `hello_elementor_load_textdomain` filter hook
= 2.6.1 - 2022-07-11 =
* Tweak: Tables looks weird on dark backgrounds ([#126](https://github.com/elementor/hello-theme/issues/126))
* Fix: Remove unnecessary PHP tags ([#213](https://github.com/elementor/hello-theme/issues/213))
= 2.6.0 - 2022-07-10 =
* Tweak: Added `theme_support` for `script` and `style` to avoid validation warnings ([#184](https://github.com/elementor/hello-theme/issues/184))
* Tweak: Sanitized content for allowed HTML tags in post title ([#118](https://github.com/elementor/hello-theme/issues/118))
* Tweak: Changed the containers to `max-width: 1140px` instead of `960px` to align with the header-footer width
* Tweak: Centering the page title for better consistency in all cases
* Tweak: Added link between the customizer to Elementor global settings
* Tweak: Added Skip Links to custom or dynamic header for better accessibility
* Fix: Added output escaping in several places ([#194](https://github.com/elementor/hello-theme/issues/194))
* Fix: Post Password Form Submit button alignment (Props [@romanbondar](https://github.com/romanbondar))
* Fix: Fatal error when kit doesn't exist or needs to be recreated ([#175](https://github.com/elementor/hello-theme/issues/175))
= 2.5.0 - 2022-01-26 =
* Tweak: Added keyboard navigation to Hello Elementor theme menus
* Tweak: Added Skip Links and `#content` for the main wrapper for better accessibility ([#133](https://github.com/elementor/hello-theme/issues/133))
* Tweak: Added underline for text links in Post Content for better accessibility
* Tweak: Removed `outline: none` from inputs for better accessibility
* Fix: Footer menu location is not being presented on sites that are not running Elementor
= 2.4.2 - 2021-12-20 =
* Tweak: Use HTTPS in XFN profile link to prevent mixed content error ([Topic](https://wordpress.org/support/topic/url-scheme-in-xfn-profile-link/))
* Tweak: Remove comments in `style.min.css` output ([#179](https://github.com/elementor/hello-theme/issues/179))
* Tweak: Promoted Hello Elementor theme Header & Footer experiment status to Stable
* Tweak: Added compatibility for upcoming WordPress version 5.9
= 2.4.1 - 2021-07-07 =
* Fix: Hello Elementor theme Header & Footer experiment should be inactive for existing sites
= 2.4.0 - 2021-06-29 =
* New: Introducing Header and Footer site elements as an Elementor Experiment
* Tweak: Updated Elementor admin notices UI
= 2.3.1 - 2020-12-28 =
* Tweak: Improved UI for table elements
* Tweak: Added support for Gutenberg Wide and Full image formats (Props [@ramiy](https://github.com/ramiy))
* Tweak: Added font smoothing
* Tweak: Update `Tested up to 5.6`
* Tweak: Update `Requires PHP 5.6`
* Fix: Adjusted font-family in `code`, `pre`, `kbd` and `samp` elements (Props [@75th](https://github.com/75th))
= 2.3.0 - 2020-04-19 =
* Tweak: Removed caption centering by default to allow alignment using Elementor (Props [@cirkut](https://github.com/cirkut))
* Tweak: Removed `text-align` property from table elements to avoid alignment issue in RTL websites (Props [@ramiy](https://github.com/ramiy))
* Tweak: Added `input[type="url"]` to CSS reset rules ([#109](https://github.com/elementor/hello-theme/issues/109))
* Tweak: Update `Tested up to 5.4`
= 2.2.2 - 2019-12-23 =
* Fix: Conflicts with minifier `cssnano` and CSS animations (Props [@CeliaRozalenM](https://github.com/CeliaRozalenM))
* Fix: Max-width property is missing in `_archive.scss` (Props [@redpik](https://github.com/redpik))
= 2.2.1 - 2019-09-10 =
* Tweak: Added max width to `wp-caption` ([#91](https://github.com/elementor/hello-theme/issues/91))
* Tweak: Added support of `wp_body_open`
= 2.2.0 - 2019-07-22 =
* Tweak: Added viewport content filter ([#49](https://github.com/elementor/hello-theme/issues/49))
* Tweak: Added support Hide Title in Elementor
* Tweak: Adhere to TRT's Theme Sniffer
= 2.1.2 - 2019-06-19 =
* Tweak: Added theme version to enqueued styles
* Tweak: Remove header tags with `hello_elementor_page_title` filter
= 2.1.1 - 2019-06-13 =
* Tweak: Rename `Install Elementor Now` button to `Install Elementor`
= 2.1.0 - 2019-06-12 =
* New: Added basic theme styling
* New: Added tagline under the site name in header
* New: Added `hello_elementor_page_title` filter for show\hide page title
* New: Added `hello_elementor_enqueue_theme_style` filter for enqueue theme-specific style
* Tweak: Hide site name & tagline if logo file is exist
* Tweak: Hide default page list when there is no primary menu
* Tweak: Removed `#main` in `archive.php`, `single.php`, `search.php` & `404.php` files
* Tweak: Removed `#site-header` in `header.php` file
* Tweak: Replaced `#top-menu` with `.site-navigation`
* Tweak: Removed custom SCSS directory, it is recommended to use child theme instead of editing parent theme
= 2.0.7 - 2019-06-04 =
* Tweak: Added nextpage support to `single.php`
* Tweak: Keep both original and minified css files
* Tweak: Removed `flexible-header`, `custom-colors`, `editor-style` tags
= 2.0.6 - 2019-05-08 =
* Tweak: Removed irrelevant font family from `$font-family-base`
* Fix: Minified `style.css` for better optimization
= 2.0.5 - 2019-05-21 =
* New: Introducing [Hello Theme Child](https://github.com/elementor/hello-theme-child)
* Tweak: Enqueue only parent theme stylesheet
* Tweak: Added admin notice box for recommending Elementor plugin
= 2.0.4 - 2019-05-20 =
* Tweak: Removed `accessibility-ready` tag from `style.css`
= 2.0.3 - 2019-05-19 =
* Tweak: Removed `accessibility-ready` tag
= 2.0.2 - 2019-05-13 =
* Tweak: Added `hello_elementor_content_width` filter, as per WordPress best practice
= 2.0.1 - 2019-05-12 =
* Tweak: Updated theme screenshot (following comment by WP Theme Review team)
= 2.0.0 - 2019-05-12 =
* Tweak: Updated theme screenshot (following comment by WP Theme Review team)
* Tweak: Add Copyright & Image and Icon License sections in readme (following comment by WP Theme Review team)
* Tweak: Remove duplicated call to `add_theme_support( 'custom-logo')`
* Tweak: Readme file grammar & spelling
* Tweak: Update `Tested up to 5.2`
* Tweak: Change functions.php methods names prefix from `hello_elementor_theme_` to `hello_elementor_`
* Tweak: Change hook names to fit theme's name. Old hooks are deprecated, users are urged to update their code where needed
* Tweak: Update style for `img`, `textarea`, 'label'
= 1.2.0 - 2019-02-12 =
* New: Added classic-editor.css for Classic editor
* Tweak: A lot of changes to match theme review guidelines
* Tweak: Updated theme screenshot
= 1.1.1 - 2019-01-28 =
* Tweak: Removed padding reset for lists
= 1.1.0 - 2018-12-26 =
* New: Added SCSS & do thorough style reset
* New: Added readme file
* New: Added `elementor_hello_theme_load_textdomain` filter for load theme's textdomain
* New: Added `elementor_hello_theme_register_menus` filter for register the theme's default menu location
* New: Added `elementor_hello_theme_add_theme_support` filter for register the various supported features
* New: Added `elementor_hello_theme_add_woocommerce_support` filter for register woocommerce features, including product-gallery zoom, swipe & lightbox features
* New: Added `elementor_hello_theme_enqueue_style` filter for enqueue style
* New: Added `elementor_hello_theme_register_elementor_locations` filter for register elementor settings
* New: Added child-theme preparations
* New: Added template part search
* New: Added translation support
* Tweak: Re-write of already existing template parts
= 1.0.0 - 2018-03-19 =
* Initial Public Release

Binary file not shown.

After

Width:  |  Height:  |  Size: 108 KiB

View File

@@ -0,0 +1,14 @@
<?php
/**
* The template for displaying sidebar.
*
* @package HelloElementor
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
/**
* This file is here to avoid the Deprecated Message for sidebar by wp-includes/theme-compat/sidebar.php.
*/

View File

@@ -0,0 +1,601 @@
/*
Theme Name: Hello Elementor
Theme URI: https://elementor.com/hello-theme/?utm_source=wp-themes&utm_campaign=theme-uri&utm_medium=wp-dash
Description: Hello Elementor is a lightweight and minimalist WordPress theme that was built specifically to work seamlessly with the Elementor site builder plugin. The theme is free, open-source, and designed for users who want a flexible, easy-to-use, and customizable website. The theme, which is optimized for performance, provides a solid foundation for users to build their own unique designs using the Elementor drag-and-drop site builder. Its simplicity and flexibility make it a great choice for both beginners and experienced Web Creators.
Author: Elementor Team
Author URI: https://elementor.com/?utm_source=wp-themes&utm_campaign=author-uri&utm_medium=wp-dash
Version: 3.0.1
Stable tag: 3.0.1
Requires at least: 6.0
Tested up to: 6.4
Requires PHP: 7.3
License: GNU General Public License v3 or later.
License URI: https://www.gnu.org/licenses/gpl-3.0.html
Text Domain: hello-elementor
Tags: accessibility-ready, flexible-header, custom-colors, custom-menu, custom-logo, featured-images, rtl-language-support, threaded-comments, translation-ready,
*/
/**
* Loading first in the style.scss & classic-editor.scss
*/
/**
* Document basic styling
* Inspired by Normalize.css, HTML5 Boilerplate & Bootstrap Reboot Projects under MIT License
*/
/**
* 1. Correct the line height in all browsers.
* 2. Prevent adjustments of font size after orientation changes in iOS.
* 3. Change from `box-sizing: content-box` so that `width` is not affected by `padding` or `border`.
*/
html {
line-height: 1.15; /* 1 */
-webkit-text-size-adjust: 100%; /* 2 */
}
*,
*::before,
*::after {
box-sizing: border-box; /* 3 */
}
/* Sections
*/
body {
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
font-size: 1rem;
font-weight: 400;
line-height: 1.5;
color: #333333;
background-color: #fff;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
/**
* Correct the font size and margin on `h1` elements within `section` and
* `article` contexts in Chrome, Firefox, and Safari.
*/
h1, h2, h3, h4, h5, h6 {
margin-block-start: 0.5rem;
margin-block-end: 1rem;
font-family: inherit;
font-weight: 500;
line-height: 1.2;
color: inherit;
}
h1 {
font-size: 2.5rem;
}
h2 {
font-size: 2rem;
}
h3 {
font-size: 1.75rem;
}
h4 {
font-size: 1.5rem;
}
h5 {
font-size: 1.25rem;
}
h6 {
font-size: 1rem;
}
p {
margin-block-start: 0;
margin-block-end: 0.9rem;
}
/* Grouping content
*/
/**
* 1. Add the correct box sizing in Firefox.
* 2. Show the overflow in Edge and IE.
*/
hr {
box-sizing: content-box; /* 1 */
height: 0; /* 1 */
overflow: visible; /* 2 */
}
/**
* 1. Correct the inheritance and scaling of font size in all browsers.
* 2. Correct the odd `em` font sizing in all browsers.
*/
pre {
font-family: monospace, monospace; /* 1 */
font-size: 1em; /* 2 */
white-space: pre-wrap;
}
/* Text-level semantics
*/
a {
background-color: transparent;
text-decoration: none;
color: #CC3366;
}
a:hover, a:active {
color: #333366;
}
a:not([href]):not([tabindex]) {
color: inherit;
text-decoration: none;
}
a:not([href]):not([tabindex]):hover, a:not([href]):not([tabindex]):focus {
color: inherit;
text-decoration: none;
}
a:not([href]):not([tabindex]):focus {
outline: 0;
}
/**
* 1. Remove the bottom border in Chrome 57-
* 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari.
*/
abbr[title] {
border-block-end: none; /* 1 */
text-decoration: underline dotted; /* 2 */
}
/**
* Add the correct font weight in Chrome, Edge, and Safari.
*/
b,
strong {
font-weight: bolder;
}
/**
* 1. Correct the inheritance and scaling of font size in all browsers.
* 2. Correct the odd `em` font sizing in all browsers.
*/
code,
kbd,
samp {
font-family: monospace, monospace; /* 1 */
font-size: 1em; /* 2 */
}
/**
* Add the correct font size in all browsers.
*/
small {
font-size: 80%;
}
/**
* Prevent `sub` and `sup` elements from affecting the line height in
* all browsers.
*/
sub,
sup {
font-size: 75%;
line-height: 0;
position: relative;
vertical-align: baseline;
}
sub {
bottom: -0.25em;
}
sup {
top: -0.5em;
}
/* Embedded content
*/
/**
* Remove the border on images inside links in IE 10.
*/
img {
border-style: none;
height: auto;
max-width: 100%;
}
/* Interactive
*/
/*
* Add the correct display in Edge, IE 10+, and Firefox.
*/
details {
display: block;
}
/*
* Add the correct display in all browsers.
*/
summary {
display: list-item;
}
figcaption {
font-size: 16px;
color: #333333;
line-height: 1.4;
font-style: italic;
font-weight: 400;
}
/* Misc
*/
/**
* Add the correct display in IE 10+.
*/
template {
display: none;
}
/**
* Add the correct display in IE 10.
*/
[hidden] {
display: none;
}
/* Print
*/
@media print {
*,
*:before,
*:after {
background: transparent !important;
color: #000 !important; /* Black prints faster */
-webkit-box-shadow: none !important;
box-shadow: none !important;
text-shadow: none !important;
}
a,
a:visited {
text-decoration: underline;
}
a[href]:after {
content: " (" attr(href) ")";
}
abbr[title]:after {
content: " (" attr(title) ")";
}
a[href^="#"]:after,
a[href^="javascript:"]:after {
content: "";
}
pre {
white-space: pre-wrap !important;
}
pre,
blockquote {
break-inside: avoid;
border: 1px solid #cccccc;
}
thead {
display: table-header-group;
}
tr,
img {
break-inside: avoid;
}
p,
h2,
h3 {
orphans: 3;
widows: 3;
}
h2,
h3 {
break-after: avoid;
}
}
/**
* Form styling
*/
label {
display: inline-block;
line-height: 1;
vertical-align: middle;
}
/**
* 1. Change the font styles in all browsers.
* 2. Remove the margin in Firefox and Safari.
*/
button,
input,
optgroup,
select,
textarea {
font-family: inherit; /* 1 */
font-size: 1rem; /* 1 */
line-height: 1.5; /* 1 */
margin: 0; /* 2 */
}
input[type=text],
input[type=date],
input[type=email],
input[type=number],
input[type=password],
input[type=search],
input[type=tel],
input[type=url],
select,
textarea {
width: 100%;
border: solid 1px #666666;
border-radius: 3px;
padding: 0.5rem 1rem;
transition: all 0.3s;
}
input[type=text]:focus,
input[type=date]:focus,
input[type=email]:focus,
input[type=number]:focus,
input[type=password]:focus,
input[type=search]:focus,
input[type=tel]:focus,
input[type=url]:focus,
select:focus,
textarea:focus {
border-color: #333333;
}
/**
* Show the overflow in IE.
* 1. Show the overflow in Edge.
*/
button,
input { /* 1 */
overflow: visible;
}
/**
* Remove the inheritance of text transform in Edge, Firefox, and IE.
* 1. Remove the inheritance of text transform in Firefox.
*/
button,
select { /* 1 */
text-transform: none;
}
/**
* Correct the inability to style clickable types in iOS and Safari.
*/
button,
[type=button],
[type=reset],
[type=submit] {
width: auto;
-webkit-appearance: button;
}
/**
* Remove the inner border and padding in Firefox.
*/
button::-moz-focus-inner,
[type=button]::-moz-focus-inner,
[type=reset]::-moz-focus-inner,
[type=submit]::-moz-focus-inner {
border-style: none;
padding: 0;
}
/**
* Restore the focus styles unset by the previous rule.
*/
button:-moz-focusring,
[type=button]:-moz-focusring,
[type=reset]:-moz-focusring,
[type=submit]:-moz-focusring {
outline: 1px dotted ButtonText;
}
button,
[type=submit],
[type=button] {
display: inline-block;
font-weight: 400;
color: #CC3366;
text-align: center;
white-space: nowrap;
user-select: none;
background-color: transparent;
border: 1px solid #CC3366;
padding: 0.5rem 1rem;
font-size: 1rem;
border-radius: 3px;
transition: all 0.3s;
}
button:focus,
[type=submit]:focus,
[type=button]:focus {
outline: 5px auto -webkit-focus-ring-color;
}
button:hover, button:focus,
[type=submit]:hover,
[type=submit]:focus,
[type=button]:hover,
[type=button]:focus {
color: #ffffff;
background-color: #CC3366;
text-decoration: none;
}
button:not(:disabled),
[type=submit]:not(:disabled),
[type=button]:not(:disabled) {
cursor: pointer;
}
/**
* Correct the padding in Firefox.
*/
fieldset {
padding: 0.35em 0.75em 0.625em;
}
/**
* 1. Correct the text wrapping in Edge and IE.
* 2. Correct the color inheritance from `fieldset` elements in IE.
* 3. Remove the padding so developers are not caught out when they zero out
* `fieldset` elements in all browsers.
*/
legend {
box-sizing: border-box; /* 1 */
color: inherit; /* 2 */
display: table; /* 1 */
max-width: 100%; /* 1 */
padding: 0; /* 3 */
white-space: normal; /* 1 */
}
/**
* Add the correct vertical alignment in Chrome, Firefox, and Opera.
*/
progress {
vertical-align: baseline;
}
/**
* Remove the default vertical scrollbar in IE 10+.
*/
textarea {
overflow: auto;
resize: vertical;
}
/**
* 1. Add the correct box sizing in IE 10.
* 2. Remove the padding in IE 10.
*/
[type=checkbox],
[type=radio] {
box-sizing: border-box; /* 1 */
padding: 0; /* 2 */
}
/**
* Correct the cursor style of increment and decrement buttons in Chrome.
*/
[type=number]::-webkit-inner-spin-button,
[type=number]::-webkit-outer-spin-button {
height: auto;
}
/**
* 1. Correct the odd appearance in Chrome and Safari.
* 2. Correct the outline style in Safari.
*/
[type=search] {
-webkit-appearance: textfield; /* 1 */
outline-offset: -2px; /* 2 */
}
/**
* Remove the inner padding in Chrome and Safari on macOS.
*/
[type=search]::-webkit-search-decoration {
-webkit-appearance: none;
}
/**
* 1. Correct the inability to style clickable types in iOS and Safari.
* 2. Change font properties to `inherit` in Safari.
*/
::-webkit-file-upload-button {
-webkit-appearance: button; /* 1 */
font: inherit; /* 2 */
}
select {
display: block;
}
/**
* Table styling
*/
table {
background-color: transparent;
width: 100%;
margin-block-end: 15px;
font-size: 0.9em;
border-spacing: 0;
border-collapse: collapse;
}
table th,
table td {
padding: 15px;
line-height: 1.5;
vertical-align: top;
border: 1px solid rgba(128, 128, 128, 0.5019607843);
}
table th {
font-weight: bold;
}
table thead th,
table tfoot th {
font-size: 1em;
}
table caption + thead tr:first-child th,
table caption + thead tr:first-child td,
table caption + thead tr:first-child th,
table caption + thead tr:first-child td,
table colgroup + thead tr:first-child th,
table colgroup + thead tr:first-child td,
table colgroup + thead tr:first-child th,
table colgroup + thead tr:first-child td,
table thead:first-child tr:first-child th,
table thead:first-child tr:first-child td,
table thead:first-child tr:first-child th,
table thead:first-child tr:first-child td {
border-block-start: 1px solid rgba(128, 128, 128, 0.5019607843);
}
table tbody > tr:nth-child(odd) > td,
table tbody > tr:nth-child(odd) > th {
background-color: rgba(128, 128, 128, 0.0705882353);
}
table tbody tr:hover > td,
table tbody tr:hover > th {
background-color: rgba(128, 128, 128, 0.1019607843);
}
table tbody + tbody {
border-block-start: 2px solid rgba(128, 128, 128, 0.5019607843);
}
@media (max-width: 767px) {
table table {
font-size: 0.8em;
}
table table th,
table table td {
padding: 7px;
line-height: 1.3;
}
table table th {
font-weight: 400;
}
}
/**
* List styling
*/
dl,
dt,
dd,
ol,
ul,
li {
margin-block-start: 0;
margin-block-end: 0;
border: 0;
outline: 0;
font-size: 100%;
vertical-align: baseline;
background: transparent;
}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,24 @@
<?php
/**
* The template for displaying 404 pages (not found).
*
* @package HelloElementor
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
?>
<main id="content" class="site-main">
<?php if ( apply_filters( 'hello_elementor_page_title', true ) ) : ?>
<header class="page-header">
<h1 class="entry-title"><?php echo esc_html__( 'The page can&rsquo;t be found.', 'hello-elementor' ); ?></h1>
</header>
<?php endif; ?>
<div class="page-content">
<p><?php echo esc_html__( 'It looks like nothing was found at this location.', 'hello-elementor' ); ?></p>
</div>
</main>

View File

@@ -0,0 +1,55 @@
<?php
/**
* The template for displaying archive pages.
*
* @package HelloElementor
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
?>
<main id="content" class="site-main">
<?php if ( apply_filters( 'hello_elementor_page_title', true ) ) : ?>
<header class="page-header">
<?php
the_archive_title( '<h1 class="entry-title">', '</h1>' );
the_archive_description( '<p class="archive-description">', '</p>' );
?>
</header>
<?php endif; ?>
<div class="page-content">
<?php
while ( have_posts() ) {
the_post();
$post_link = get_permalink();
?>
<article class="post">
<?php
printf( '<h2 class="%s"><a href="%s">%s</a></h2>', 'entry-title', esc_url( $post_link ), wp_kses_post( get_the_title() ) );
if ( has_post_thumbnail() ) {
printf( '<a href="%s">%s</a>', esc_url( $post_link ), get_the_post_thumbnail( $post, 'large' ) );
}
the_excerpt();
?>
</article>
<?php } ?>
</div>
<?php wp_link_pages(); ?>
<?php
global $wp_query;
if ( $wp_query->max_num_pages > 1 ) :
?>
<nav class="pagination">
<?php /* Translators: HTML arrow */ ?>
<div class="nav-previous"><?php next_posts_link( sprintf( __( '%s older', 'hello-elementor' ), '<span class="meta-nav">&larr;</span>' ) ); ?></div>
<?php /* Translators: HTML arrow */ ?>
<div class="nav-next"><?php previous_posts_link( sprintf( __( 'newer %s', 'hello-elementor' ), '<span class="meta-nav">&rarr;</span>' ) ); ?></div>
</nav>
<?php endif; ?>
</main>

View File

@@ -0,0 +1,61 @@
<?php
/**
* The template for displaying footer.
*
* @package HelloElementor
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
$is_editor = isset( $_GET['elementor-preview'] );
$site_name = get_bloginfo( 'name' );
$tagline = get_bloginfo( 'description', 'display' );
$footer_class = did_action( 'elementor/loaded' ) ? esc_attr( hello_get_footer_layout_class() ) : '';
$footer_nav_menu = wp_nav_menu( [
'theme_location' => 'menu-2',
'fallback_cb' => false,
'echo' => false,
] );
?>
<footer id="site-footer" class="site-footer dynamic-footer <?php echo esc_attr( $footer_class ); ?>">
<div class="footer-inner">
<div class="site-branding show-<?php echo esc_attr( hello_elementor_get_setting( 'hello_footer_logo_type' ) ); ?>">
<?php if ( has_custom_logo() && ( 'title' !== hello_elementor_get_setting( 'hello_footer_logo_type' ) || $is_editor ) ) : ?>
<div class="site-logo <?php echo esc_attr( hello_show_or_hide( 'hello_footer_logo_display' ) ); ?>">
<?php the_custom_logo(); ?>
</div>
<?php endif;
if ( $site_name && ( 'logo' !== hello_elementor_get_setting( 'hello_footer_logo_type' ) ) || $is_editor ) : ?>
<h4 class="site-title <?php echo esc_attr( hello_show_or_hide( 'hello_footer_logo_display' ) ); ?>">
<a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr__( 'Home', 'hello-elementor' ); ?>" rel="home">
<?php echo esc_html( $site_name ); ?>
</a>
</h4>
<?php endif;
if ( $tagline || $is_editor ) : ?>
<p class="site-description <?php echo esc_attr( hello_show_or_hide( 'hello_footer_tagline_display' ) ); ?>">
<?php echo esc_html( $tagline ); ?>
</p>
<?php endif; ?>
</div>
<?php if ( $footer_nav_menu ) : ?>
<nav class="site-navigation <?php echo esc_attr( hello_show_or_hide( 'hello_footer_menu_display' ) ); ?>">
<?php
// PHPCS - escaped by WordPress with "wp_nav_menu"
echo $footer_nav_menu; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
?>
</nav>
<?php endif; ?>
<?php if ( '' !== hello_elementor_get_setting( 'hello_footer_copyright_text' ) || $is_editor ) : ?>
<div class="copyright <?php echo esc_attr( hello_show_or_hide( 'hello_footer_copyright_display' ) ); ?>">
<p><?php echo wp_kses_post( hello_elementor_get_setting( 'hello_footer_copyright_text' ) ); ?></p>
</div>
<?php endif; ?>
</div>
</footer>

View File

@@ -0,0 +1,70 @@
<?php
/**
* The template for displaying header.
*
* @package HelloElementor
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
if ( ! hello_get_header_display() ) {
return;
}
$is_editor = isset( $_GET['elementor-preview'] );
$site_name = get_bloginfo( 'name' );
$tagline = get_bloginfo( 'description', 'display' );
$header_nav_menu = wp_nav_menu( [
'theme_location' => 'menu-1',
'fallback_cb' => false,
'echo' => false,
] );
?>
<header id="site-header" class="site-header dynamic-header <?php echo esc_attr( hello_get_header_layout_class() ); ?>">
<div class="header-inner">
<div class="site-branding show-<?php echo esc_attr( hello_elementor_get_setting( 'hello_header_logo_type' ) ); ?>">
<?php if ( has_custom_logo() && ( 'title' !== hello_elementor_get_setting( 'hello_header_logo_type' ) || $is_editor ) ) : ?>
<div class="site-logo <?php echo esc_attr( hello_show_or_hide( 'hello_header_logo_display' ) ); ?>">
<?php the_custom_logo(); ?>
</div>
<?php endif;
if ( $site_name && ( 'logo' !== hello_elementor_get_setting( 'hello_header_logo_type' ) || $is_editor ) ) : ?>
<h1 class="site-title <?php echo esc_attr( hello_show_or_hide( 'hello_header_logo_display' ) ); ?>">
<a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr__( 'Home', 'hello-elementor' ); ?>" rel="home">
<?php echo esc_html( $site_name ); ?>
</a>
</h1>
<?php endif;
if ( $tagline && ( hello_elementor_get_setting( 'hello_header_tagline_display' ) || $is_editor ) ) : ?>
<p class="site-description <?php echo esc_attr( hello_show_or_hide( 'hello_header_tagline_display' ) ); ?>">
<?php echo esc_html( $tagline ); ?>
</p>
<?php endif; ?>
</div>
<?php if ( $header_nav_menu ) : ?>
<nav class="site-navigation <?php echo esc_attr( hello_show_or_hide( 'hello_header_menu_display' ) ); ?>">
<?php
// PHPCS - escaped by WordPress with "wp_nav_menu"
echo $header_nav_menu; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
?>
</nav>
<div class="site-navigation-toggle-holder <?php echo esc_attr( hello_show_or_hide( 'hello_header_menu_display' ) ); ?>">
<div class="site-navigation-toggle" role="button" tabindex="0">
<i class="eicon-menu-bar" aria-hidden="true"></i>
<span class="screen-reader-text"><?php echo esc_html__( 'Menu', 'hello-elementor' ); ?></span>
</div>
</div>
<nav class="site-navigation-dropdown <?php echo esc_attr( hello_show_or_hide( 'hello_header_menu_display' ) ); ?>">
<?php
// PHPCS - escaped by WordPress with "wp_nav_menu"
echo $header_nav_menu; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
?>
</nav>
<?php endif; ?>
</div>
</header>

View File

@@ -0,0 +1,27 @@
<?php
/**
* The template for displaying footer.
*
* @package HelloElementor
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
$footer_nav_menu = wp_nav_menu( [
'theme_location' => 'menu-2',
'fallback_cb' => false,
'echo' => false,
] );
?>
<footer id="site-footer" class="site-footer">
<?php if ( $footer_nav_menu ) : ?>
<nav class="site-navigation">
<?php
// PHPCS - escaped by WordPress with "wp_nav_menu"
echo $footer_nav_menu; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
?>
</nav>
<?php endif; ?>
</footer>

View File

@@ -0,0 +1,51 @@
<?php
/**
* The template for displaying header.
*
* @package HelloElementor
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
$site_name = get_bloginfo( 'name' );
$tagline = get_bloginfo( 'description', 'display' );
$header_nav_menu = wp_nav_menu( [
'theme_location' => 'menu-1',
'fallback_cb' => false,
'echo' => false,
] );
?>
<header id="site-header" class="site-header">
<div class="site-branding">
<?php
if ( has_custom_logo() ) {
the_custom_logo();
} elseif ( $site_name ) {
?>
<h1 class="site-title">
<a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr__( 'Home', 'hello-elementor' ); ?>" rel="home">
<?php echo esc_html( $site_name ); ?>
</a>
</h1>
<p class="site-description">
<?php
if ( $tagline ) {
echo esc_html( $tagline );
}
?>
</p>
<?php } ?>
</div>
<?php if ( $header_nav_menu ) : ?>
<nav class="site-navigation">
<?php
// PHPCS - escaped by WordPress with "wp_nav_menu"
echo $header_nav_menu; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
?>
</nav>
<?php endif; ?>
</header>

View File

@@ -0,0 +1,61 @@
<?php
/**
* The template for displaying search results.
*
* @package HelloElementor
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
?>
<main id="content" class="site-main">
<?php if ( apply_filters( 'hello_elementor_page_title', true ) ) : ?>
<header class="page-header">
<h1 class="entry-title">
<?php echo esc_html__( 'Search results for: ', 'hello-elementor' ); ?>
<span><?php echo get_search_query(); ?></span>
</h1>
</header>
<?php endif; ?>
<div class="page-content">
<?php if ( have_posts() ) : ?>
<?php
while ( have_posts() ) :
the_post();
$post_link = get_permalink();
?>
<article class="post">
<?php
printf( '<h2 class="%s"><a href="%s">%s</a></h2>', 'entry-title', esc_url( $post_link ), wp_kses_post( get_the_title() ) );
if ( has_post_thumbnail() ) {
printf( '<a href="%s">%s</a>', esc_url( $post_link ), get_the_post_thumbnail( $post, 'large' ) );
}
the_excerpt();
?>
</article>
<?php
endwhile;
?>
<?php else : ?>
<p><?php echo esc_html__( 'It seems we can\'t find what you\'re looking for.', 'hello-elementor' ); ?></p>
<?php endif; ?>
</div>
<?php wp_link_pages(); ?>
<?php
global $wp_query;
if ( $wp_query->max_num_pages > 1 ) :
?>
<nav class="pagination">
<?php /* Translators: HTML arrow */ ?>
<div class="nav-previous"><?php next_posts_link( sprintf( __( '%s older', 'hello-elementor' ), '<span class="meta-nav">&larr;</span>' ) ); ?></div>
<?php /* Translators: HTML arrow */ ?>
<div class="nav-next"><?php previous_posts_link( sprintf( __( 'newer %s', 'hello-elementor' ), '<span class="meta-nav">&rarr;</span>' ) ); ?></div>
</nav>
<?php endif; ?>
</main>

View File

@@ -0,0 +1,37 @@
<?php
/**
* The template for displaying singular post-types: posts, pages and user-defined custom post types.
*
* @package HelloElementor
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
while ( have_posts() ) :
the_post();
?>
<main id="content" <?php post_class( 'site-main' ); ?>>
<?php if ( apply_filters( 'hello_elementor_page_title', true ) ) : ?>
<header class="page-header">
<?php the_title( '<h1 class="entry-title">', '</h1>' ); ?>
</header>
<?php endif; ?>
<div class="page-content">
<?php the_content(); ?>
<div class="post-tags">
<?php the_tags( '<span class="tag-links">' . esc_html__( 'Tagged ', 'hello-elementor' ), null, '</span>' ); ?>
</div>
<?php wp_link_pages(); ?>
</div>
<?php comments_template(); ?>
</main>
<?php
endwhile;

View File

@@ -0,0 +1,306 @@
@charset "UTF-8";
/**
* Loading first in the style.scss & classic-editor.scss
*/
/**
* General - https://wordpress.org/documentation/article/css/
*/
.page-content a,
.comments-area a {
text-decoration: underline;
}
.alignright {
float: right;
margin-left: 1rem;
}
.alignleft {
float: left;
margin-right: 1rem;
}
.aligncenter {
clear: both;
display: block;
margin-left: auto;
margin-right: auto;
}
.alignwide {
margin-left: -80px;
margin-right: -80px;
}
.alignfull {
margin-left: calc(50% - 50vw);
margin-right: calc(50% - 50vw);
max-width: 100vw;
width: 100vw;
}
.alignfull img {
width: 100vw;
}
.wp-caption {
margin-block-end: 1.25rem;
max-width: 100%;
}
.wp-caption.alignleft {
margin: 5px 20px 20px 0;
}
.wp-caption.alignright {
margin: 5px 0 20px 20px;
}
.wp-caption img {
display: block;
margin-left: auto;
margin-right: auto;
}
.wp-caption-text {
margin: 0;
}
.gallery-caption {
display: block;
font-size: 0.8125rem;
line-height: 1.5;
margin: 0;
padding: 0.75rem;
}
.pagination {
margin: 20px auto;
}
.sticky {
position: relative;
display: block;
}
.bypostauthor {
font-size: inherit;
}
.hide {
display: none !important;
}
.post-password-form p {
width: 100%;
display: flex;
align-items: flex-end;
}
.post-password-form [type=submit] {
margin-inline-start: 3px;
}
/**
* Utility styles
*/
.screen-reader-text {
clip: rect(1px, 1px, 1px, 1px);
height: 1px;
overflow: hidden;
position: absolute !important;
width: 1px;
word-wrap: normal !important; /* Many screen reader and browser combinations announce broken words as they would appear visually. */
}
.screen-reader-text:focus {
background-color: #eeeeee;
clip: auto !important;
clip-path: none;
color: #333333;
display: block;
font-size: 1rem;
height: auto;
left: 5px;
line-height: normal;
padding: 15px 23px 14px;
text-decoration: none;
top: 5px;
width: auto;
z-index: 100000; /* Above WP toolbar. */
}
/**
* Post item in archive pages
*/
.post .entry-title a {
text-decoration: none;
}
.post .wp-post-image {
width: 100%;
max-height: 500px;
object-fit: cover;
}
@media (max-width: 991px) {
.post .wp-post-image {
max-height: 400px;
}
}
@media (max-width: 575px) {
.post .wp-post-image {
max-height: 300px;
}
}
/**
* Comments
*/
#comments .comment-list {
margin: 0;
padding: 0;
list-style: none;
font-size: 0.9em;
}
#comments .comment,
#comments .pingback {
position: relative;
}
#comments .comment .comment-body,
#comments .pingback .comment-body {
display: flex;
flex-direction: column;
padding-block-start: 30px;
padding-block-end: 30px;
padding-inline-start: 60px;
padding-inline-end: 0;
border-block-end: 1px solid #cccccc;
}
#comments .comment .avatar,
#comments .pingback .avatar {
position: absolute;
left: 0;
border-radius: 50%;
margin-inline-end: 10px;
}
html[dir=rtl] #comments .comment .avatar, body.rtl #comments .comment .avatar,
html[dir=rtl] #comments .pingback .avatar,
body.rtl #comments .pingback .avatar {
left: auto;
right: 0;
}
#comments .comment-meta {
display: flex;
justify-content: space-between;
margin-block-end: 0.9rem;
}
#comments .reply,
#comments .comment-metadata {
font-size: 11px;
line-height: 1;
}
#comments .children {
position: relative;
list-style: none;
margin: 0;
padding-inline-start: 30px;
}
#comments .children li:last-child {
padding-block-end: 0;
}
#comments ol.comment-list .children:before {
display: inline-block;
font-size: 1em;
font-weight: normal;
line-height: 100%;
content: "↪";
position: absolute;
top: 45px;
left: 0;
width: auto;
}
html[dir=rtl] #comments ol.comment-list .children:before, body.rtl #comments ol.comment-list .children:before {
content: "↩";
left: auto;
right: 0;
}
@media (min-width: 768px) {
#comments .comment-author,
#comments .comment-metadata {
line-height: 1;
}
}
@media (max-width: 767px) {
#comments .comment .comment-body {
padding: 30px 0;
}
#comments .children {
padding-inline-start: 20px;
}
#comments .comment .avatar {
position: inherit;
float: left;
}
html[dir=rtl] #comments .comment .avatar, body.rtl #comments .comment .avatar {
float: right;
}
}
/**
* Responsive layouts
*/
.site-header .header-inner, .site-header:not(.dynamic-header), .site-footer .footer-inner, .site-footer:not(.dynamic-footer), body:not([class*=elementor-page-]) .site-main, .page-header .entry-title {
margin-inline-start: auto;
margin-inline-end: auto;
width: 100%;
}
@media (max-width: 575px) {
.site-header .header-inner, .site-header:not(.dynamic-header), .site-footer .footer-inner, .site-footer:not(.dynamic-footer), body:not([class*=elementor-page-]) .site-main, .page-header .entry-title {
padding-inline-start: 10px;
padding-inline-end: 10px;
}
}
@media (min-width: 576px) {
.site-header .header-inner, .site-header:not(.dynamic-header), .site-footer .footer-inner, .site-footer:not(.dynamic-footer), body:not([class*=elementor-page-]) .site-main, .page-header .entry-title {
max-width: 500px;
}
.site-header.header-full-width .header-inner {
max-width: 100%;
}
.site-footer.footer-full-width .footer-inner {
max-width: 100%;
}
}
@media (min-width: 768px) {
.site-header .header-inner, .site-header:not(.dynamic-header), .site-footer .footer-inner, .site-footer:not(.dynamic-footer), body:not([class*=elementor-page-]) .site-main, .page-header .entry-title {
max-width: 600px;
}
.site-header.header-full-width {
max-width: 100%;
}
.site-footer.footer-full-width {
max-width: 100%;
}
}
@media (min-width: 992px) {
.site-header .header-inner, .site-header:not(.dynamic-header), .site-footer .footer-inner, .site-footer:not(.dynamic-footer), body:not([class*=elementor-page-]) .site-main, .page-header .entry-title {
max-width: 800px;
}
.site-header.header-full-width {
max-width: 100%;
}
.site-footer.footer-full-width {
max-width: 100%;
}
}
@media (min-width: 1200px) {
.site-header .header-inner, .site-header:not(.dynamic-header), .site-footer .footer-inner, .site-footer:not(.dynamic-footer), body:not([class*=elementor-page-]) .site-main, .page-header .entry-title {
max-width: 1140px;
}
.site-header.header-full-width {
max-width: 100%;
}
.site-footer.footer-full-width {
max-width: 100%;
}
}
.site-header + .elementor {
min-height: calc(100vh - 320px);
}

File diff suppressed because one or more lines are too long