My Admin bar covers my sticky navbar [closed]

You can try this code with add in functions.php file of your current’s theme: add_action(‘wp_head’, ‘my_wp_head’); function my_wp_head(){ echo ‘<style>’ .PHP_EOL .’body{ padding-top: 70px !important; }’ .PHP_EOL .’body.body-logged-in .navbar-fixed-top{ top: 46px !important; }’ .PHP_EOL .’body.logged-in .navbar-fixed-top{ top: 46px !important; }’ .PHP_EOL .’@media only screen and (min-width: 783px) {‘ .PHP_EOL .’body{ padding-top: 70px !important; }’ .PHP_EOL … Read more

Inject widgets from one sidebar into another with PHP

Here’s an (untested) idea where we inject the sidebar-inject sidebar before sidebar-target sidebar with help of the dynamic_sidebar_before hook : add_action( ‘dynamic_sidebar_before’, ‘wpse_inject_sidebar’, 10, 2 ); function wpse_inject_sidebar( $index, $has_widgets ) { // Only target front-end if( is_admin() ) return; // Only target ‘sidebar-target’ if( ‘sidebar-target’ !== $index ) return; // Make sure ‘sidebar-inject’ is … Read more

OptimizePress Theme Overriding add_filter page_template

Had to switch the filter to the template_include hook. Don’t know if that is the correct way to do it, but it works: function _plc_template_include ($template) { $pages = _plc_get_custom_pages(); foreach ($pages as $slug => $title) { if (is_page ($slug) && is_file (PLC_TEMPLATES . $slug . ‘.tpl.php’)) { ob_start(); include PLC_TEMPLATES . $slug . ‘.tpl.php’; … Read more

Make it possible to pick a color theme for specific pages

You can add custom metabox for each page. Paste the following code to functions.php class colorMetabox { private $screen = array( ‘post’, ); private $meta_fields = array( array( ‘label’ => ‘Page Color’, ‘id’ => ‘page_color’, ‘type’ => ‘color’, ), ); public function __construct() { add_action( ‘add_meta_boxes’, array( $this, ‘add_meta_boxes’ ) ); add_action( ‘save_post’, array( $this, … Read more

Console error, even if everything is working?

The colour picker is working fine because it’s a separate script being enqueued as a dependency of custom-script-handle. So even if custom-script-handle isn’t loading because the URL is wrong the colour picker script will still load. If you don’t enqueue custom-script-handle then the colour picker won’t work because the script is being enqueued at all. … Read more

title, content, feature images

your code in some minor error. you can not write ‘the_content’ like this. this is a function. your are missing brackets. your code: <?php the_title; ?> <?php the_content; ?> Replace with this: <?php the_content(); ?> <?php the_title(); ?> AND for image ‘the_post_thumbnail()’ remove argument array. and check it For more detail: https://developer.wordpress.org/reference/functions/the_post_thumbnail/