• Resolved Dual Flex

    (@frank-fournier)


    Hi all,

    I have created a Page template that works with the theme Twenty tweelve but not with Customizr…

    The page template allows my WP editors to create a page with a floating back (“retour” in french) button on the right.

    With Customizr I only see my buttons (no content…).

    Any code to show how to display the current content of my page?

    My code :

    <?php
    /*
    Template Name: Avec_bouton_retour
    */
    
    get_header(); ?>
    
    <style type="text/css">
    #access {display: none;}
    #branding {display: none;}
    body.custom-background
    {
    background-color:#F7B054;
    }
    </style>
    
    <div style="float:right;margin-right:20px;">
    <a name="haut"></a>
    <input onclick="history.back(-1)" type="button" value="Retour" style="text-align:right;color:#4D4D4D;" />
    </div>
    <div style="clear: both;"></div>
    
    		<div id="primary">
    			<div id="content" role="main">
    
    				<?php while ( have_posts() ) : the_post(); ?>
    					<?php get_template_part( 'content', 'page' ); ?>
    				<?php endwhile; // end of the loop. ?>
    
    			</div><!-- #content -->
    		</div><!-- #primary -->
    
    <div style="float:right;margin-right:20px;margin-bottom:20px;">
    <input onclick="history.back(-1)" type="button" value="Retour" style="text-align:right;color:#4D4D4D;" />
    </div>
    <div style="clear: both;"></div>
    
    <?php get_footer(); ?>

    ==============
    Many thanks!

Viewing 7 replies - 1 through 7 (of 7 total)
  • rdellconsulting

    (@rdellconsulting)

    Not sure I understand, but if you want to examine the HTML generated then use F12 key. Depending on browser, this will open up a Code Inspector (& other tools).

    For better diagnosis, try using Firebug

    Thread Starter Dual Flex

    (@frank-fournier)

    Thanks for your concern.

    My site is under construction (french highschool).

    My Page Template allows me to choose my page type (vanilla or the one with a floating “back” button.

    Here is an example with the default type (You see the expression “Here my content” in the page):

    https://promotic.cstj.ep.profweb.qc.ca/labo/

    Here is an example with my new Page template type (You don’t see the expression “Here my content” but rather just my floating button (no effective content of the page):

    https://promotic.cstj.ep.profweb.qc.ca/diners/

    See the buttons on the right side? I also noticed that the breadcrumb disapeared!

    My code does not stick to the way Customizr works…

    ??
    ==========

    Thread Starter Dual Flex

    (@frank-fournier)

    Hi,

    Got it working by tweaking the custom-page.php example from the parent theme!

    It is surely not an elegant solution. I have surrounded the Loop action with my <DIV> (button).

    What would be an elegant solution? I am new to WP, action, filters etc. I have injected my CSS + DIV directly in the code… Is there a more elegant path to follow?

    Any tutorial to dive in the inner working of Customizr? Facinating stuff!

    My code :

    <?php
    /*
    Template Name: Avec_bouton_retourZ
    */
    ?>
    
    <style type="text/css">
    #access {display: none;}
    #branding {display: none;}
    body.custom-background
    {
    background-color:#F7B054;
    }
    </style>
    
    <?php
    /*
    Template Name: Custom Page Example
    */
    ?>
    <?php do_action( '__before_main_wrapper' ); ##hook of the header with get_header ?>
    <div id="main-wrapper" class="<?php echo tc__f( 'tc_main_wrapper_classes' , 'container' ) ?>">
    
        <?php do_action( '__before_main_container' ); ##hook of the featured page (priority 10) and breadcrumb (priority 20)...and whatever you need! ?>
    
        <div class="container" role="main">
            <div class="row">
    
                <?php do_action( '__before_article_container'); ##hook of left sidebar?>
    
                    <div id="content" class="<?php echo tc__f( '__screen_layout' , tc__f ( '__ID' ) , 'class' ) ?> article-container">
    
                        <?php do_action ('__before_loop');##hooks the header of the list of post : archive, search... ?>
    
                            <?php if ( have_posts() ) : ?>
                                <?php while ( have_posts() ) : ##all other cases for single and lists: post, custom post type, page, archives, search, 404 ?>
    
                                    <?php the_post(); ?>
    
                                    <?php do_action ('__before_article') ?>
                                        <article <?php tc__f('__article_selectors') ?>>
    
    										<div style="float:right;margin-right:20px;">
    										<a name="haut"></a>
    										<input onclick="history.back(-1)"   type="button" value="Retour" style="text-align:right;color:#4D4D4D;" />
    										</div>
    										<div style="clear: both;"></div>
    
    										<?php do_action( '__loop' ); ?>
    
                                            <div style="float:right;margin-right:20px;">
    										<a name="haut"></a>
    										<input onclick="history.back(-1)" type="button" value="Retour" style="text-align:right;color:#4D4D4D;" />
    										</div>
    										<div style="clear: both;"></div>
    
                                        </article>
                                    <?php do_action ('__after_article') ?>
    
                                <?php endwhile; ?>
    
                            <?php endif; ##end if have posts ?>
    
                        <?php do_action ('__after_loop');##hook of the comments and the posts navigation with priorities 10 and 20 ?>
    
                    </div><!--.article-container -->
    
               <?php do_action( '__after_article_container'); ##hook of left sidebar ?>
    
            </div><!--.row -->
        </div><!-- .container role: main -->
    
        <?php do_action( '__after_main_container' ); ?>
    
    </div><!--#main-wrapper"-->
    
    <?php do_action( '__after_main_wrapper' );##hook of the footer with get_get_footer ?>
    
    <?php get_footer(); ?>

    Thanks for any follow up!
    ??
    =============

    rdellconsulting

    (@rdellconsulting)

    There is a Hooks & Filters tutorial in the pipeline.

    Thread Starter Dual Flex

    (@frank-fournier)

    What is the pipeline? (URL plz)
    ??

    rdellconsulting

    (@rdellconsulting)

    Sorry, I mean it is planned for release in the future but no date as yet.

    Thread Starter Dual Flex

    (@frank-fournier)

    Hi rdell,

    off topic issue…:

    I am trying to create a new thread and it is not appearing in the forum but I see it in my profile history?

    Any hint?

    ??

    [answered here https://www.ads-software.com/support/topic/my-post-not-appearing-in-a-specific-wp-forum?replies=2&view=all ]

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘First step with Page template in Child-theme’ is closed to new replies.