Forum Replies Created

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi @komal-maru,

    Sure.

    Thread Starter jakubmudra123

    (@jakubmudra123)

    Thank you very much! ??

    Thread Starter jakubmudra123

    (@jakubmudra123)

    Thread Starter jakubmudra123

    (@jakubmudra123)

    Thanks for answer.

    Yes, im using some plugins. I disabled all of them, but nothing changed. Heres my functions.php.

    <?php
    /**
     * Migration functions and definitions.
     *
     * Sets up the theme and provides some helper functions, which are used
     * in the theme as custom template tags. Others are attached to action and
     * filter hooks in WordPress to change core functionality.
     *
     * Functions that are not pluggable (not wrapped in function_exists()) are instead attached
     * to a filter or action hook.
     *
     * For more information on hooks, actions, and filters, see https://codex.www.ads-software.com/Plugin_API.
     *
     */
    
    /**
     * Sets up theme defaults and registers the various WordPress features that
     * the Migration theme supports.
     *
     * @uses add_editor_style() To add a Visual Editor stylesheet.
     * @uses add_theme_support() To add support for post thumbnails
     * @uses register_nav_menu() To add support for navigation menus.
     * @uses set_post_thumbnail_size() To set a custom post thumbnail size.
     *
     */
    function migration_setup() {
    
    	// This theme styles the visual editor with editor-style.css to give it some niceties.
    	add_editor_style();
    
    	// This theme uses wp_nav_menu() in one location.
    	register_nav_menu( 'o_stitne_zlaze', __( 'O ?títné ?láze', 'o_stitne_zlaze' ) );
    	register_nav_menu( 'nemoci_stitne_zlazy', __( 'Nemoci ?títné ?lázy', 'nemoci_stitne_zlazy' ) );
    	register_nav_menu( 'karcinom_stitne_zlazy', __( 'Karcinom ?títné ?lázy', 'karcinom_stitne_zlazy' ) );
    	register_nav_menu( 'lecba_karcinomu', __( 'Lé?ba karcinomu', 'lecba_karcinomu' ) );
    	register_nav_menu( 'kontakt', __( 'Kontakt', 'kontakt' ) );
    	register_nav_menu( 'mohlo_by_vas_zajimat', __( 'Mohlo by vás zajímat', 'mohlo_by_vas_zajimat' ) );
    	register_nav_menu( 'casto_hledate', __( '?asto hledáte', 'casto_hledate' ) );
    	register_nav_menu( 'videa', __( 'Videa', 'videa' ) );
    	register_nav_menu( 'footer', __( 'Pati?ka', 'footer' ) );
    
    	// This theme uses a custom image size for featured images, displayed on "standard" posts.
    	add_theme_support( 'post-thumbnails' );
    	set_post_thumbnail_size( 500, 9999 ); // Unlimited height, soft crop
    }
    
    add_action( 'after_setup_theme', 'migration_setup' );
    
    if (function_exists('acf_add_options_page')) {
     
        acf_add_options_page(array(
            'page_title'    => 'Obecné nastavení',
            'menu_title'    => 'Nastavení ?abl.',
            'menu_slug'     => 'nastaveni',
            'capability'    => 'edit_posts',
            'redirect'      => false
        ));
     
        acf_add_options_sub_page(array(
            'page_title'    => 'Nastavení hlavi?ky',
            'menu_title'    => 'Hlavi?ka',
            'parent_slug'   => 'nastaveni',
        ));
     
        acf_add_options_sub_page(array(
            'page_title'    => 'Nastavení pati?ky',
            'menu_title'    => 'Pati?ka',
            'parent_slug'   => 'nastaveni',
        ));
         acf_add_options_sub_page(array(
            'page_title'    => 'Nastavení 404',
            'menu_title'    => '404',
            'parent_slug'   => 'nastaveni',
        ));
     
    }
    
    // ====== option 2, used ====== //
    
    // This does the same actually, taken from https://css.dzone.com/news/wordpress-wpnavmenu-separator
    function nav_menu_first_last( $items,$args ) {
    
    	 if( $args->theme_location == 'o_stitne_zlaze' OR $args->theme_location == 'nemoci_stitne_zlazy' OR $args->theme_location == 'karcinom_stitne_zlazy' OR $args->theme_location == 'lecba_karcinomu' OR $args->theme_location == 'kontakt' ){
    		 $pos = strrpos($items, 'class="menu-item', -1);
    		 $items=substr_replace($items, 'menu-item-last ', $pos+7, 0);
    		 $pos = strpos($items, 'class="menu-item');
    		 $items=substr_replace($items, 'vetsi  ', $pos+7, 0);
    	}
    	return $items;
    }
    add_filter( 'wp_nav_menu_items', 'nav_menu_first_last', 10, 2);
    /**
     * Enqueues scripts and styles for front-end.
     */
    function migration_scripts_styles() {
    	global $wp_styles;
    
    	/*
    	 * Loads our main stylesheet.
    	 */
    	wp_enqueue_style( 'migration-style', get_stylesheet_uri() );
    
    	/*
    	 * Optional: Loads the Internet Explorer specific stylesheet.
    	 */
    	//wp_enqueue_style( 'migration-ie', get_template_directory_uri() . '/css/ie.css', array( 'migration-style' ), '20121010' );
    	//$wp_styles->add_data( 'migration-ie', 'conditional', 'lt IE 9' );
    }
    add_action( 'wp_enqueue_scripts', 'migration_scripts_styles' );
    
    • This reply was modified 7 years, 8 months ago by jakubmudra123.
Viewing 4 replies - 1 through 4 (of 4 total)