• I need to add and image that have the lenght of the normal TwentyEleven Menu just under it. The image will span on top of the page and the right column…

    I saw a main div that are right at the good spot

    WordPress newbie here…

    Thanks

Viewing 15 replies - 1 through 15 (of 17 total)
  • Do not edit the Twenty Eleven theme. It is the default WordPress theme and having access to an unedited version of the theme is vital when dealing with a range of site issues. First create a child theme for your changes.

    Thread Starter Patrick Toulze

    (@patrick-toulze)

    Thank Esmi — I’m working mostly on Joomla and this is for friend that manage a web site for foundation (free of charge)

    The child Theme concept seem easy… Some kind of override…

    If I understand well…
    A just have to add a “style.css” in a directory with the name of my child theme (e.g: mychildthemedirectory in —> wp-content/themes

    Now I need that image to appear only in the home page— Not in all menu – Only Home…

    Create a front-page.php template file in your child theme.

    Thread Starter Patrick Toulze

    (@patrick-toulze)

    Thanks a lot to guide me for that…

    Can I use The existing #main to insert a custom module or I have to create another new “position” to receive my custom module in the override front-page.php

    I guess front-page.php have to be a copy of the original and I work from there?

    Sorry to use “Joomla” Terms….

    You could use what ever markup/layout you want in the new front-page.php template. As long as the page includes the Loop (assuming you do want to be able to edit it from the back end), you don’t have to re-use any of the existing ids, classes or layouts. To get started, I’d suggest copying page.php and renaming the copy front-page.php. Then grab all of the code from content-page.php and use that to replace <?php get_template_part( 'content', 'page' ); ?>. Also remove <?php comments_template( '', true ); ?> if you won’t ever want comments on the front page.

    Once that’s all done., start pulling out what you don’t want and changing the divs to suit your needs.

    Thread Starter Patrick Toulze

    (@patrick-toulze)

    First, I want to thank you for your patience…

    Ok I create a Child Theme…

    site_root (www) — wp-content of twentyeleven
    ? themes (directory)
    – twentyeleven (original theme directory)
    – twentyeleven-child ( Child theme directory)
    ? style.css
    ? front-page.php

    I’m a little confuse about front-page.php and is content…

    1? You said:

    copying page.php and renaming the copy front-page.php

    a— I guess that page.php is in the original twentyeleven folder ?
    b— It will still work in the child theme if rename front-page.php?

    2? For the content of front-page.php
    You said:

    grab all of the code from content-page.php and use that to replace <?php get_template_part( ‘content’, ‘page’ ); ?>

    a— I guess that content-page.php is in the original twentyeleven folder ?
    b— I have to take all the content (minus <?php comments_template( ”, true ); ?>) of content-page.php and replace that snippet of code (<?php get_template_part( ‘content’, ‘page’ ); ?>) in my child theme front-page.php ?

    3? After doing all that, how do I add a section just under the menu where I can add text/images than can be control by the backend and menu sensitive that span the full width of the front page?

    Something like that?
    https://wpmu.org/how-to-widgetize-a-page-post-header-or-any-other-template-in-wordpress/

    Just for fun I css a background to the actual #main div at https://fondationjeannecrevier.org/ and it seem to occupied exactly the space I need. 4? How come I cannot use that div to place a widget/module….

    5? If I create a child front-page.php — I guess I have to add a div and do whatever I’m suppose to do (Question 4) to “widgetise” it and place it here:
    #main
    —> #mynewwidgetizediv (same level than)
    —> #primary

    a— I guess that page.php is in the original twentyeleven folder ?
    b— It will still work in the child theme if rename front-page.php?

    a) Yes. When a child theme is active, WP pulls the relevant template file from the child in preference to the parent. It’s only when a given file isn’t in the child’s folder (presumably because you didn’t want to customise it) that it looks on the parent’s folder. The priority order always goes:
    Child -> Parent -> Core

    b) Yes. That’s down to the template hierarchy. If you have a look in Theme Development, there’s a a pretty extensive flow chart that outlines how the hierarchy works. In this situation, WP looks for front-page.php first (in the child theme).

    a— I guess that content-page.php is in the original twentyeleven folder ?
    b— I have to take all the content (minus <?php comments_template( ”, true ); ?>) of content-page.php and replace that snippet of code (<?php get_template_part( ‘content’, ‘page’ ); ?>) in my child theme front-page.php ?

    a) Sorry – yes. When creating a child theme, you can usually grab the relevant file from the parent, move it into the child and start amending it. The only major exceptions are style.css and functions.php.

    b) Yes – that would be the quickest way to get started and have something concrete and working to play with.

    how do I add a section just under the menu where I can add text/images than can be control by the backend and menu sensitive that span the full width of the front page?

    The world’s your oyster here. You can add whatever you want to top of the child’s front page.php file. If you want it to be editable via the backend, you have 3 main options:

    1. Create a widget-aware area in the new template and use a Text Widget (from appearance -> Widgets) to add the new content.

    2. Have a look at some of the banner rotator plugins such as https://www.ads-software.com/extend/plugins/cimy-header-image-rotator/ install one and add its code to the new template.

    3. Create a secondary Loop in the new template and control the content via a daft or private Post/Page. This is the most flexible but also the most difficult route coding-wise. You’d need to have a look at https://codex.www.ads-software.com/Function_Reference/WP_Query to create the new Loop.

    How come I cannot use that div to place a widget/module….

    You can. See above. ??

    I guess I have to add a div and do whatever I’m suppose to do (Question 4) to “widgetise” it and place it here:
    #main

    I’d suggest adding it just after #main. The #main div is generated by the header.php template file in Twenty Eleven. So by the time WP gets to your front-page.php, it will already be on the page.

    Hey Folks – I am trying to do the same thing, I created a new page template; code is here:
    `<?php
    /**
    * Template Name: TEST Template
    * Description: A Page Template that adds a sidebar to pages
    *
    * @package WordPress
    * @subpackage Twenty_Eleven
    * @since Twenty Eleven 1.0
    */

    get_header(); ?>

    <div id=”primary”>

    <?php if ( is_active_sidebar( ‘custom’ ) ) : ?>
    <div class=”widget-area”>
    <?php dynamic_sidebar( ‘custom’ ); ?>
    <?php endif; ?>

    <?php while ( have_posts() ) : the_post(); ?>

    <?php get_template_part( ‘content’, ‘page’ ); ?>

    <?php comments_template( ”, true ); ?>

    <?php endwhile; // end of the loop. ?>

    </div><!– #content –>
    </div><!– #primary –>

    <?php get_sidebar(); ?>
    <?php get_footer(); ?>’

    Everything went well, but I’ve managed to push the sidebar down on page…… https://108.167.147.21/~mrmaz00/a-test-page/
    TIA!

    BTW – the image of the young girl is in the custom widget from this thread!

    Why is the sidebar pushing down the page when i add content to the main page??? anyone???

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    May you post a new thread depicting this issue?

    Thread Starter Patrick Toulze

    (@patrick-toulze)

    I want to tank you Emi for your clear answers — As I was saying — I’m doing this for free and your help is really appreciated. More, This is give me a glimpse to WordPress architecture…

    Never know, Joomla is cool but WordPress is probably as cool…

    I’m looking at your links and all and trying to grasp the concept…. Getting there! — Thanks.

    I definitly want to add an backend accessible “widgetise” section.

    Step 1 : — Create the child theme
    ? site_root (www)
    — wp-content
    — themes (directory where all themes are)
    — twentyeleven (directory of our example parent theme, Twenty Eleven)

    twentyeleven-child (directory of our child theme; can be named anything)

    Step 2 : — Create —style.css (required file in a child theme; must be named style.css)
    Minimum content = (the information header code and the Import rule) and whatever I need

    Step 3 : — Create the front-page.php (The front page template, it is only used if you use a static front page.) — Use your way :

    I’d suggest copying page.php and renaming the copy front-page.php. Then grab all of the code from content-page.php and use that to replace <?php get_template_part( ‘content’, ‘page’ ); ?>. Also remove <?php comments_template( ”, true ); ?> if you won’t ever want comments on the front page.

    Once that’s all done., start pulling out what you don’t want and changing the divs to suit your needs.

    Step 4 : — Add a Widgetize aera Using the way in the link you propose…

    I should be able now to add a Widget in the backend to add Text/image/Whatever I need….

    ? My last question (hopefully) is How do you assign that Aera to only the front page and not all the other pages.

    The last thing I need to understand is that part — Need to go there and read…

    3. Create a secondary Loop in the new template and control the content via a daft or private Post/Page. This is the most flexible but also the most difficult route coding-wise. You’d need to have a look at https://codex.www.ads-software.com/Function_Reference/WP_Query to create the new Loop.

    I’m happy to find WordPress Forum as active and usefull than Joomal !

    Thanks again “esmi”!

    Thread Starter Patrick Toulze

    (@patrick-toulze)

    Can I activate my Child theme and keep the background image and all the same as the parent theme?

    Thread Starter Patrick Toulze

    (@patrick-toulze)

    Another question: Ok I see that “Previsualisation” of the theme can maybe change the default of my child theme.
    I try to add an images->headers and add the original custom theme header image and thumbnails there thinking that I can change that before activating my theme…

    Not available in the choice??

    Thread Starter Patrick Toulze

    (@patrick-toulze)

    This is my front-page.php without any modif other than the one you tell me. But I probably did it wrong…

    because the front page loose the right column,bottom of first article and footer all gone…..

    <?php
    /**
     * The template for displaying all pages.
     *
     * This is the template that displays all pages by default.
     * Please note that this is the WordPress construct of pages
     * and that other 'pages' on your WordPress site will use a
     * different template.
     *
     * @package WordPress
     * @subpackage Twenty_Eleven
     * @since Twenty Eleven 1.0
     */
    
    get_header(); ?>
    
    		<div id="primary">
    			<div id="content" role="main">
    
    				<?php the_post(); ?>
    
                    <?php /*?>  Copy of content-page.php to replace  —> <?php get_template_part( 'content', 'page' ); ?>   ---------------  <?php */?>
    
                     <?php
    /**
     * The template used for displaying page content in page.php
     *
     * @package WordPress
     * @subpackage Twenty_Eleven
     * @since Twenty Eleven 1.0
     */
    ?>
    
    <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    	<header class="entry-header">
    		<h1 class="entry-title"><?php the_title(); ?></h1>
    	</header><!-- .entry-header -->
    
    	<div class="entry-content">
    		<?php the_content(); ?>
    		<?php wp_link_pages( array( 'before' => '<div class="page-link"><span>' . __( 'Pages:', 'twentyeleven' ) . '</span>', 'after' => '</div>' ) ); ?>
    	</div><!-- .entry-content -->
    	<footer class="entry-meta">
    		<?php edit_post_link( __( 'Edit', 'twentyeleven' ), '<span class="edit-link">', '</span>' ); ?>
    	</footer><!-- .entry-meta -->
    </article><!-- #post-<?php the_ID(); ?> -->
    
    				<?php /*?> END---------------------- <?php */?>
    
    				<?php /*?> REMOVE FOR NO FRONT COMMENT <?php comments_template( '', true ); ?> <?php */?>
    
    			</div><!-- #content -->
    		</div><!-- #primary -->
    
    <?php get_footer(); ?>
Viewing 15 replies - 1 through 15 (of 17 total)
  • The topic ‘TwentyEleven – Need to add sitewide image under menu?’ is closed to new replies.