WordPress.org

Ready to get started?Download WordPress

Forums

URGENT, how to have a particular post without siderbar and Header Title ? (15 posts)

  1. aniee
    Member
    Posted 1 year ago #

    Hey ,
    I want to to have a particular post without sidebar and header title, this is for one post only, the theme is magazine basic
    my website is alphaability.com

    plz tell me how to do it, URGENT

    How to create a separate post template without sidebar and footer and title heading

  2. theotherlebowski
    Member
    Posted 1 year ago #

    you'll need to create a page template and tweak the contents of the file, read this for some pointers...

  3. aniee
    Member
    Posted 1 year ago #

    yeah how to create a single.php file, and what codes to put in ti so that the sidebar, website title and footer contents are not present in that particular post .

    Plz tell me what codes to put on it, i am just new to coding.

  4. theotherlebowski
    Member
    Posted 1 year ago #

    copy the page.php file (a page might be better to use) for this and create a new txt file, paste in the contents. save the new file as my_custom_page.php then add in the following the very top of the file

    <?php
    /*
    Template Name: my_custom_page
    */
    ?>

    then upload this file to your theme folder.

    go to your dashboard and create a new page, select the page template using the dropdown menu on the right hand side and click publish.

    navigate to the page in your site and then start making changes to the new template file using appearance -> themes -> editor. (select your theme if it's not already set) and click on my_custom_page.php on the right handside and start taking stuff out and seeing if that works.... save the file to see your changes.

    (*** make sure that you keep track of the things you cahnge, if you need to add them back in then keep open the original text file you created as a back up ***)

  5. aniee
    Member
    Posted 1 year ago #

    thanks, i am testing it...
    :)

  6. theotherlebowski
    Member
    Posted 1 year ago #

    cool, hope it works :D

  7. aniee
    Member
    Posted 1 year ago #

    hey , i just uploaded it , and it uploaded fine, but the header title and sidebar, footer All are still visible in this my_custom_page.php

    what might be the issue ??

  8. theotherlebowski
    Member
    Posted 1 year ago #

    right, thats the next step. if you've added it to the page then publish the page and view it.

    open another tab in your browser so you can edit the template file my_custom_page.php

    so appearance -> themes -> editor. select the my_custom_page,php file in the list on the right and it should open the code editor in the main panel.

    you're looking for php shortcodes like

    <?php get_sidebar(); ?>

    you can either delete these (not advisable) or comment them out by adding

    /* */

    inside the php tags like this

    <?php /*get_sidebar();*/ ?>`

    do the same for things like the footer. not too sure about the header title, what theme are you using?

  9. aniee
    Member
    Posted 1 year ago #

    i am using magazine basic theme , of wordpress

  10. aniee
    Member
    Posted 1 year ago #

    the total code which i copied from page.php was

    <?php get_header(); ?>
    	<?php get_template_part( 'loop', 'page' ); ?>
    <?php get_footer(); ?>

    that was the total code in it, there is no get_sidebar, why that cud be ?

  11. alchymyth
    The Sweeper & Moderator
    Posted 1 year ago #

    to have a particular post without sidebar and header title, this is for one post only,

    please post a direct link to this one post;

    you might be able to do this with css alone - not ideal, but possibly faster than editing templates.

  12. aniee
    Member
    Posted 1 year ago #

    ok that post is THIS

  13. alchymyth
    The Sweeper & Moderator
    Posted 1 year ago #

    example:

    .page-id-88 #sidebar { display:none; }
    .page-id-88 #leftcontent{ margin-left:110px; }

    or

    .page-id-88 #sidebar{ display:none; }
    .page-id-88 #leftcontent{ width:98%; }

    you need to repair some broken code in the header, as the #header div does not seem to be closed; possibly some others as well;

    validation report

    http://codex.wordpress.org/Validating_a_Website

  14. aniee
    Member
    Posted 1 year ago #

    sorry plz i don't get it ^ , what exactly to do ?

  15. skywalker108
    Member
    Posted 1 year ago #

    Hi, I am also having the same problem.
    @ Aniee the .page-id-88 code goes in your css stylesheet.

    I was moving around the sidebars trying to take them out of the footer where they had been and put them into the index.php so I could use <?php get_sidebar(); ?> and not put it on the single.php

    this is the code I had in my footer

    <?php
    		$loc = pbt_theme_option('sidebar_location');
    		if($loc==2 || $loc==4) {
    			get_sidebar(); // calling the First Sidebar
    		}
    		if(pbt_theme_option('sidebar_width2')!=0 && $loc!=3) get_sidebar( "second" ); // calling the Second Sidebar
    	?>

    Any ideas how I can set this up so I can comment out the sidebars on single page? The site is bright-warrior.com
    Thanks

Topic Closed

This topic has been closed to new replies.

About this Topic