Classic Boxing Coach

Member

Forum Replies Created

  • In reply to: Relocating slider to a different page

    #12477

    Sorry for the long delay in responding… life got a little hectic there for a bit!

    Anyways, I renamed the ‘advanced-cache.php file, but it didn’t help. It still crashes the whole site, i.e. a blank screen.

    In reply to: Relocating slider to a different page

    #12475

    Well, after moving the offending plugins to another folder and I activated the code and still got blanked out screens. Also, the only errors being reported now are:

    Warning: include_once(/home/Web/classicboxingcoach.com/html/boxing/inthecorner/wp-content/plugins/wp-super-cache/wp-cache-phase1.php): failed to open stream: No such file or directory in /home/Web/classicboxingcoach.com/html/boxing/wp-content/advanced-cache.php on line 8
    Warning: include_once(): Failed opening '/home/Web/classicboxingcoach.com/html/boxing/inthecorner/wp-content/plugins/wp-super-cache/wp-cache-phase1.php' for inclusion (include_path='.:/usr/share/pear:/usr/share/smarty') in /home/Web/classicboxingcoach.com/html/boxing/wp-content/advanced-cache.php on line 8

    In reply to: Relocating slider to a different page

    #12473

    Syahir,

    Well – I got more than I expected! Looks like I’ve got lots of plug-in related errors:

    Warning: include_once(/home/Web/classicboxingcoach.com/html/boxing/inthecorner/wp-content/plugins/wp-super-cache/wp-cache-phase1.php): failed to open stream: No such file or directory in /home/Web/classicboxingcoach.com/html/boxing/wp-content/advanced-cache.php on line 8
    Warning: include_once(): Failed opening '/home/Web/classicboxingcoach.com/html/boxing/inthecorner/wp-content/plugins/wp-super-cache/wp-cache-phase1.php' for inclusion (include_path='.:/usr/share/pear:/usr/share/smarty') in /home/Web/classicboxingcoach.com/html/boxing/wp-content/advanced-cache.php on line 8
    Notice: Undefined index: aiosp_enabled in /home/Web/classicboxingcoach.com/html/boxing/wp-content/plugins/all-in-one-seo-pack/all_in_one_seo_pack.php on line 766
    Notice: Undefined index: aiosp_enabled in /home/Web/classicboxingcoach.com/html/boxing/wp-content/plugins/all-in-one-seo-pack/all_in_one_seo_pack.php on line 766
    Notice: Use of undefined constant mrt_update_notice - assumed 'mrt_update_notice' in /home/Web/classicboxingcoach.com/html/boxing/wp-content/plugins/wp-security-scan/securityscan.php on line 48
    Notice: Use of undefined constant mrt_wpdberrors - assumed 'mrt_wpdberrors' in /home/Web/classicboxingcoach.com/html/boxing/wp-content/plugins/wp-security-scan/securityscan.php on line 50
    Notice: Use of undefined constant mrt_wpdberrors - assumed 'mrt_wpdberrors' in /home/Web/classicboxingcoach.com/html/boxing/wp-content/plugins/wp-security-scan/securityscan.php on line 51
    Notice: Use of undefined constant mrt_remove_wp_version - assumed 'mrt_remove_wp_version' in /home/Web/classicboxingcoach.com/html/boxing/wp-content/plugins/wp-security-scan/securityscan.php on line 53

    If I’m correct, the plug-in super cache appears to be trying to cache a directory (‘in the corner’) but that directory no longer exists (I deleted it some time ago). And the SEO and Security plug-in appear to have undefined terms. Who knew?

    Anyhow – is this the type of thing that is causing my troubles?

    In reply to: Relocating slider to a different page

    #12471

    When I comment out everything except the suggested code, I get blank pages. I’m perplexed.

    In reply to: Relocating slider to a different page

    #12470

    Hrm… didn’t work. I commented out the bit you identify above, but when I uncomment the suggested code I get the same result I described above: blank pages.

    If you believe there is a problem in my functions.php file, I will experiment with commenting out sections to determine where there may be a conflict. I’ll let you know what I find.

    Of course, any additional input is greatly appreciated.

    Classic Boxing Coach

    http://www.classicboxingcoach.com

    In reply to: Relocating slider to a different page

    #12468

    Sure – here you go.

    The slider related stuff is last. As you can see, the code you suggest is first and below that is stuff I was experimenting with. All of it is currently commented out.

    The remainder of the functions.php file (or at least much of it) has been cut/pasted or adapted from other functions.php files I’ve seen. I admit, I do not completely understand it – but I have managed to make quite a few desired changes.

    <?php // custom functions.pihp template @ digwp.com
    //
    // add feed links to header
    //if (function_exists('automatic_feed_links')) {
    // automatic_feed_links();
    //} else {
    // return;
    //}

    // smart jquery inclusion
    if (!is_admin()) {
    wp_deregister_script('jquery');
    wp_register_script('jquery', ("http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"), false, '1.3.2');
    wp_enqueue_script('jquery');
    }

    // enable threaded comments
    function enable_threaded_comments(){
    if (!is_admin()) {
    if (is_singular() AND comments_open() AND (get_option('thread_comments') == 1))
    wp_enqueue_script('comment-reply');
    }
    }
    add_action('get_header', 'enable_threaded_comments');

    // remove junk from head
    remove_action('wp_head', 'rsd_link');
    remove_action('wp_head', 'wp_generator');
    remove_action('wp_head', 'feed_links', 2);
    remove_action('wp_head', 'index_rel_link');
    remove_action('wp_head', 'wlwmanifest_link');
    remove_action('wp_head', 'feed_links_extra', 3);
    remove_action('wp_head', 'start_post_rel_link', 10, 0);
    remove_action('wp_head', 'parent_post_rel_link', 10, 0);
    remove_action('wp_head', 'adjacent_posts_rel_link', 10, 0);

    // add google analytics to footer
    function add_google_analytics() {
    echo '<script src="http://www.google-analytics.com/ga.js" type="text/javascript"></script>';
    echo '<script type="text/javascript">';
    echo 'var pageTracker = _gat._getTracker("UA-XXXXX-X");';
    echo 'pageTracker._trackPageview();';
    echo '</script>';
    }
    add_action('wp_footer', 'add_google_analytics');

    // custom excerpt length
    function custom_excerpt_length($length) {
    return 20;
    }
    add_filter('excerpt_length', 'custom_excerpt_length');

    // custom excerpt ellipses for 2.9+
    function custom_excerpt_more($more) {
    return '...';
    }
    add_filter('excerpt_more', 'custom_excerpt_more');

    /* custom excerpt ellipses for 2.8-
    function custom_excerpt_more($excerpt) {
    return str_replace('[...]', '...', $excerpt);
    }
    add_filter('wp_trim_excerpt', 'custom_excerpt_more');
    */

    // no more jumping for read more link
    function no_more_jumping($post) {
    return '<a>ID).'" class="read-more">'.'Continue Reading'.'</a>';
    }
    add_filter('excerpt_more', 'no_more_jumping');

    // add a favicon
    function blog_favicon() {
    echo '<link rel="Shortcut Icon" type="image/x-icon" href="'.get_bloginfo('wpurl').'/favicon.ico" />';
    }
    add_action('wp_head', 'blog_favicon');

    // add a favicon for your admin
    function admin_favicon() {
    echo '<link rel="Shortcut Icon" type="image/x-icon" href="'.get_bloginfo('stylesheet_directory').'/images/favicon.png" />';
    }
    add_action('admin_head', 'admin_favicon');

    // custom admin login logo
    function custom_login_logo() {
    echo '<style type="text/css">

    h1 a { background-image: url('.get_bloginfo('template_directory').'/images/custom-login-logo.png) !important; }
    </style>';
    }
    add_action('login_head', 'custom_login_logo');

    // disable all widget areas
    // function disable_all_widgets($sidebars_widgets) {
    //if (is_home())
    //$sidebars_widgets = array(false);
    //return $sidebars_widgets;
    //}
    //add_filter('sidebars_widgets', 'disable_all_widgets');

    // kill the admin nag
    if (!current_user_can('edit_users')) {
    add_action('init', create_function('$a', "remove_action('init', 'wp_version_check');"), 2);
    add_filter('pre_option_update_core', create_function('$a', "return null;"));
    }

    // category id in body and post class
    function category_id_class($classes) {
    global $post;
    foreach((get_the_category($post->ID)) as $category)
    $classes [] = 'cat-' . $category->cat_ID . '-id';
    return $classes;
    }
    add_filter('post_class', 'category_id_class');
    add_filter('body_class', 'category_id_class');

    // get the first category id
    function get_first_category_ID() {
    $category = get_the_category();
    return $category[0]->cat_ID;
    }

    /* MOVE THE SLIDER FROM THE HOME PAGE TO THE BLOG PAGE */

    /*
    function graphene_display_slider(){
    if (is_home())
    graphene_slider();
    }
    */

    /*
    function graphene_display_slider(){
    graphene_slider();
    }

    add_action('template_redirect','graphene_display_slider');

    function blog_slider_mods(){
    if (is_home())
    graphene_slider();
    }

    add_action('template_redirect','blog_slider_mods');
    */

    ?>

    In reply to: Relocating slider to a different page

    #12466

    According to the WP Conditional Codex page, “is_home()” should place the slider on the Page which is set as the “Posts page” in Administration > Settings > Reading. In my case, that’s “Blog”. So I now understand your initial suggestion was correct.

    HOWEVER, I discovered this warning: You can only use conditional query tags on or after the init action hook in WordPress. For themes, this means the conditional tag will never work properly if you are using it in the body of functions.php, i.e. outside of a function.

    Might this be my issue?

    Is there a solution?

    In reply to: Relocating slider to a different page

    #12465

    Ok, I now see there is no such conditional “is_blog” and that “is_home” refers to the index page of my site.

    I believe I need to use “is_page” then – but I’m not sure how to identify the page… given that my blog page is titled “Blog”, I expected “if (is_page(Blog))” to work. I got the same result as above.

    Hmm…

    In reply to: Relocating slider to a different page

    #12464

    Thanks for such a quick response!

    So, I added the above code to my functions.php file – but it didn’t work. Instead, when I activated the child theme and slider, the site appeared blank (and the wp-admin page was rendered non-functional).

    I assumed this was because the blog page is not the ‘home’ page (i.e., my url brings you to the static front page) so I tried changing “is_home” to “is_Blog”. Still, no luck – I got the same results as above.

    Any suggestions?

    Thanks again Syahir!

    Classic Boxing Coach

    http://www.classicboxingcoach.com

Viewing 9 posts - 1 through 9 (of 9 total)