SQSBMedia
Forum Replies Created
-
Forum: Themes and Templates
In reply to: [Attitude] Child functions.phpThank you for going through the steps for me. I did everything listed above but it’s not working for some reason. I did note that “extensions” was spelled differently in a couple of places and changed that but it didn’t seem to resolve the issue. I see how the child functions.php refers to the child-header-extensions.php file and the parent functions.php file refers to the child-header-extensions.php file but how does the parent functions.php file know where to look for the child-header-extensions.php file. Also, when I perform an upgrade will the parent functions.php file be written over and then I will lose that function? Should we be putting the command to override the header-extensions.php in the child functions.php file instead maybe? Wish I was better at this php stuff. I am so appreciative of your help Ayman!
Forum: Themes and Templates
In reply to: [Attitude] Child functions.phpThank you again Ayman, you have been a tremendous help. Please forgive me, since the functions.php file is a little different I want to be sure I am placing everything in the correct spot.
So, in the child functions.php file I place the following code:
<?php function get_child_header_extentions { require_once( get_stylesheet_directory(). '/child-header-extensions.php' ); } ?>' Then, in the parent functions.php file I place the following code under the "Load Structure":
require_once( ATTITUDE_STRUCTURE_DIR . ‘/child-header-extensions.php’ );
if (!function_exists(‘get_child_header_extentions’) ){
require_once( ATTITUDE_STRUCTURE_DIR . ‘/header-extensions.php’ );
}`Replacing the portion where I tried to add the child-header-extentions require_once command.
Then I place the child-header-extensions.php file in the folder where the original header-extensions.php file is stored so that it will be recognized by the parent function.php file structure. Is all of that correct? I tried it and it’s not working for me but I am clearly no php expert so I may be confused.
Thank you again for your help!
Christie
Forum: Themes and Templates
In reply to: [Attitude] Child functions.phpThanks for your help Ayman! That all makes prefect sense. The only thing I am not sure how to incorporate is the last part about calling the child-header-extensions.php file because this theme has load files functions set up (please see code below):
<?php /** * Attitude defining constants, adding files and WordPress core functionality. * * Defining some constants, loading all the required files and Adding some core functionality. * @uses add_theme_support() To add support for post thumbnails and automatic feed links. * @uses register_nav_menu() To add support for navigation menu. * @uses set_post_thumbnail_size() To set a custom post thumbnail size. * * @package Theme Horse * @subpackage Attitude * @since Attitude 1.0 */ /** * Set the content width based on the theme's design and stylesheet. */ if ( ! isset( $content_width ) ) $content_width = 700; add_action( 'attitude_init', 'attitude_constants', 10 ); /** * This function defines the Attitude theme constants * * @since 1.0 */ function attitude_constants() { /** Define Directory Location Constants */ define( 'ATTITUDE_PARENT_DIR', get_template_directory() ); define( 'ATTITUDE_CHILD_DIR', get_stylesheet_directory() ); define( 'ATTITUDE_IMAGES_DIR', ATTITUDE_PARENT_DIR . '/images' ); define( 'ATTITUDE_LIBRARY_DIR', ATTITUDE_PARENT_DIR. '/library' ); define( 'ATTITUDE_ADMIN_DIR', ATTITUDE_LIBRARY_DIR . '/admin' ); define( 'ATTITUDE_ADMIN_IMAGES_DIR', ATTITUDE_ADMIN_DIR . '/images' ); define( 'ATTITUDE_ADMIN_JS_DIR', ATTITUDE_ADMIN_DIR . '/js' ); define( 'ATTITUDE_ADMIN_CSS_DIR', ATTITUDE_ADMIN_DIR . '/css' ); define( 'ATTITUDE_JS_DIR', ATTITUDE_LIBRARY_DIR . '/js' ); define( 'ATTITUDE_CSS_DIR', ATTITUDE_LIBRARY_DIR . '/css' ); define( 'ATTITUDE_FUNCTIONS_DIR', ATTITUDE_LIBRARY_DIR . '/functions' ); define( 'ATTITUDE_SHORTCODES_DIR', ATTITUDE_LIBRARY_DIR . '/shortcodes' ); define( 'ATTITUDE_STRUCTURE_DIR', ATTITUDE_LIBRARY_DIR . '/structure' ); if ( ! defined( 'ATTITUDE_LANGUAGES_DIR' ) ) /** So we can define with a child theme */ define( 'ATTITUDE_LANGUAGES_DIR', ATTITUDE_LIBRARY_DIR . '/languages' ); define( 'ATTITUDE_WIDGETS_DIR', ATTITUDE_LIBRARY_DIR . '/widgets' ); /** Define URL Location Constants */ define( 'ATTITUDE_PARENT_URL', get_template_directory_uri() ); define( 'ATTITUDE_CHILD_URL', get_stylesheet_directory_uri() ); define( 'ATTITUDE_IMAGES_URL', ATTITUDE_PARENT_URL . '/images' ); define( 'ATTITUDE_LIBRARY_URL', ATTITUDE_PARENT_URL . '/library' ); define( 'ATTITUDE_ADMIN_URL', ATTITUDE_LIBRARY_URL . '/admin' ); define( 'ATTITUDE_ADMIN_IMAGES_URL', ATTITUDE_ADMIN_URL . '/images' ); define( 'ATTITUDE_ADMIN_JS_URL', ATTITUDE_ADMIN_URL . '/js' ); define( 'ATTITUDE_ADMIN_CSS_URL', ATTITUDE_ADMIN_URL . '/css' ); define( 'ATTITUDE_JS_URL', ATTITUDE_LIBRARY_URL . '/js' ); define( 'ATTITUDE_CSS_URL', ATTITUDE_LIBRARY_URL . '/css' ); define( 'ATTITUDE_FUNCTIONS_URL', ATTITUDE_LIBRARY_URL . '/functions' ); define( 'ATTITUDE_SHORTCODES_URL', ATTITUDE_LIBRARY_URL . '/shortcodes' ); define( 'ATTITUDE_STRUCTURE_URL', ATTITUDE_LIBRARY_URL . '/structure' ); if ( ! defined( 'ATTITUDE_LANGUAGES_URL' ) ) /** So we can predefine to child theme */ define( 'ATTITUDE_LANGUAGES_URL', ATTITUDE_LIBRARY_URL . '/languages' ); define( 'ATTITUDE_WIDGETS_URL', ATTITUDE_LIBRARY_URL . '/widgets' ); } add_action( 'attitude_init', 'attitude_load_files', 15 ); /** * Loading the included files. * * @since 1.0 */ function attitude_load_files() { /** * attitude_add_files hook * * Adding other addtional files if needed. */ do_action( 'attitude_add_files' ); /** Load functions */ require_once( ATTITUDE_FUNCTIONS_DIR . '/i18n.php' ); require_once( ATTITUDE_FUNCTIONS_DIR . '/custom-header.php' ); require_once( ATTITUDE_FUNCTIONS_DIR . '/functions.php' ); require_once( ATTITUDE_ADMIN_DIR . '/attitude-themeoptions-defaults.php' ); require_once( ATTITUDE_ADMIN_DIR . '/theme-options.php' ); require_once( ATTITUDE_ADMIN_DIR . '/attitude-metaboxes.php' ); require_once( ATTITUDE_ADMIN_DIR . '/attitude-show-post-id.php' ); /** Load Shortcodes */ require_once( ATTITUDE_SHORTCODES_DIR . '/attitude-shortcodes.php' ); /** Load Structure */ require_once( ATTITUDE_STRUCTURE_DIR . '/child-header-extensions.php' ); require_once( ATTITUDE_STRUCTURE_DIR . '/header-extensions.php' ); require_once( ATTITUDE_STRUCTURE_DIR . '/searchform-extensions.php' ); require_once( ATTITUDE_STRUCTURE_DIR . '/sidebar-extensions.php' ); require_once( ATTITUDE_STRUCTURE_DIR . '/footer-extensions.php' ); require_once( ATTITUDE_STRUCTURE_DIR . '/content-extensions.php' ); /** Load Widgets and Widgetized Area */ require_once( ATTITUDE_WIDGETS_DIR . '/attitude_widgets.php' ); } add_action( 'attitude_init', 'attitude_core_functionality', 20 ); /** * Adding the core functionality of WordPess. * * @since 1.0 */ function attitude_core_functionality() { /** * attitude_add_functionality hook * * Adding other addtional functionality if needed. */ do_action( 'attitude_add_functionality' ); // Add default posts and comments RSS feed links to head add_theme_support( 'automatic-feed-links' ); // This theme uses Featured Images (also known as post thumbnails) for per-post/per-page. add_theme_support( 'post-thumbnails' ); // Remove WordPress version from header for security concern remove_action( 'wp_head', 'wp_generator' ); // This theme uses wp_nav_menu() in header menu location. register_nav_menu( 'primary', __( 'Primary Menu', 'attitude' ) ); // Add Attitude custom image sizes add_image_size( 'featured', 670, 300, true ); add_image_size( 'featured-medium', 230, 230, true ); add_image_size( 'slider-narrow', 1038, 460, true ); // used on Featured Slider on Homepage Header for narrow layout add_image_size( 'slider-wide', 1400, 460, true ); // used on Featured Slider on Homepage Header for wide layout add_image_size( 'gallery', 474, 342, true ); // used to show gallery all images add_image_size( 'icon', 80, 80, true ); //used for icon on business layout /** * This theme supports custom background color and image */ add_theme_support( 'custom-background' ); } /** * attitude_init hook * * Hooking some functions of functions.php file to this action hook. */ do_action( 'attitude_init' ); ?>
How do I incorporate the
if (!function_exists('get_child_header_extensions')
portion into this?Thank you again for your help!
Update: I tried adding a link within the uploaded image settings where I had left it blank before and that resolved it. My apologies for not trying that first.
Resolved.
Forum: Themes and Templates
In reply to: [Attitude] Hide Title from PagesResolved
Forum: Themes and Templates
In reply to: [Attitude] Hide Title from PagesThank you Rabin!
Forum: Plugins
In reply to: [WooCommerce] Attitude Theme CompatibilityThank you for your help James,
Here it is:
<?php /** * Displays the page section of the theme. * * @package Theme Horse * @subpackage Attitude * @since Attitude 1.0 */ ?> <?php get_header(); ?> <?php /** * attitude_before_main_container hook */ do_action( 'attitude_before_main_container' ); ?> <div id="container"> <?php /** * attitude_main_container hook * * HOOKED_FUNCTION_NAME PRIORITY * * attitude_content 10 */ do_action( 'attitude_main_container' ); ?> </div><!-- #container --> <?php /** * attitude_after_main_container hook */ do_action( 'attitude_after_main_container' ); ?> <?php get_footer(); ?>
Forum: Themes and Templates
In reply to: [Attitude] Remove space above header imageThank you for this Rabin. it works in Chrome and Firefox, however, as usual IE doesn’t react the same. For me, it causes the image I have placed in the custom header to fall behind the menu in IE9 compatibility view only. In IE9 view shows just fine. It could be the other way around. I can’t tell if blue means on or off. Any idea how to resolve this. I really like this theme and would like to use it in combination with my custom header. Thanks!
My apologies, I should have been more clear. I was speaking of the entire menu. No matter where I place the recommended code:
<?php /* Widgetized sidebar */
if ( !function_exists(‘dynamic_sidebar’) || !dynamic_sidebar(‘my_mega_menu’) ) : ?><?php endif; ?>in the header.php file, it either places the menu below the slider or at the top of the page and leaves the primary navigation as is.
Here is a link: https://dev.squarescrub.com/square_scrub/
Thanks for your help!
I have attempted the fix provided by jasonpaulweber and can almost get this working but not quite. It places it on the page but in the incorrect spot, no matter where I place the code. I am using the attitude theme. Does anyone know where I would place this code to replace the main menu for that theme? I have a slider and it either wants to place the menu at the top of the page or below the slider.
Forum: Themes and Templates
In reply to: [Attitude] Remove Comments from Pages onlyThanks for making removing these SO easy. I have stumbled across support forums that make it MUCH more complicated.