logo
Ask your WordPress questions! Pay money and get answers fast! (more info)

Warning: Please do not give out any FTP or ssh credentials to anyone, unless you trust them completely. Giving out login details is dangerous.

If the asker does not get an answer then they have 10 days to request a refund.

$10
Remove menu/header from blog page template

If i could edit the blog template (keep a backup of original of course) to not have the header (with menu etc) and footer or siderbar and apply that instead of the default blog template.

This would be applied to only the blog page (including blog category page, uses same template) so when viewed in the iframes on this page

I want to make you only see the posts, no menu/header, sidebars or footer.

See attached image for desired result (i used google chromes inspect element to delete the sidebar div, header div and footer div)

Here is the code for the blog template, however i cant see where the header, footer and sidebar are inserted

<?php
/*
* This file is a template part
* produces WordPress Loop for use in index.php (posts page)
* moved to theme root from contents folder @since version 2.6
*/

$ka_blogtitle = get_option('ka_blogtitle');
$ka_searchbar = get_option('ka_searchbar');
$ka_crumbs = get_option('ka_crumbs');
$ka_blogbutton = get_option('ka_blogbutton');
$ka_blogauthor = get_option('ka_blogauthor');
$ka_related_posts = get_option('ka_related_posts');
$ka_related_posts_title = get_option('ka_related_posts_title');
$ka_related_posts_count = get_option('ka_related_posts_count');
$ka_posted_by = get_option('ka_posted_by');
$ka_post_date = get_option('ka_post_date');
if ($ka_post_date != "false"){ $ka_post_date_result = 'style="background:none !important;"';}else{$ka_post_date_result = '';}
$ka_dragshare = get_option('ka_dragshare');
$blog_image_frame = get_option('ka_blog_image_frame');

if (have_posts()) : while (have_posts()) : the_post();

//retrieve all post meta of posts in the loop.

$linkpost = get_post_meta($post->ID, "_jcycle_url_value", $single = true);
$external_image_url = get_post_meta($post->ID,'truethemes_external_image_url',true);
$video_url = get_post_meta($post->ID,'truethemes_video_url',true);
$permalink = get_permalink($post->ID);
//prepare to get image
$thumb = get_post_thumbnail_id();
$image_width = 190;
$image_height = 111;

//use truethemes image croping script, function moved to truethemes_framework/global/basic.php
$image_src = truethemes_crop_image($thumb,$external_image_url,$image_width,$image_height);

?>

<?php
//required by theme check plugin
//need to use post_class() http://codex.wordpress.org/Template_Tags/post_class
//or http://codex.wordpress.org/Function_Reference/get_post_class
//these are special style class, use browser view source to see.
$array_post_classes = get_post_class();
$post_classes = '';
foreach($array_post_classes as $post_class){
$post_classes .= " ".$post_class;
}
?>
<div class="blog_wrap <?php echo $post_classes;?>">

<div class="post_title">

<?php truethemes_begin_post_title_hook();// action hook, see truethemes_framework/global/hooks.php ?>

<?php if ($linkpost == ''){ ?>
<h2><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h2>
<?php }else{ ?><h2><a href="<?php echo $linkpost; ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h2><?php } ?>
<?php if ($ka_posted_by != "true") {?><p class="posted-by-text"><span><?php _e('Posted by:', 'truethemes_localize') ?></span> <?php the_author_posts_link(); ?></p><?php }else{}?>

<?php truethemes_end_post_title_hook();// action hook, see truethemes_framework/global/hooks.php ?>

</div><!-- end post_title -->


<div class="post_content" <?php echo $ka_post_date_result; ?>>

<?php truethemes_begin_post_content_hook();// action hook, see truethemes_framework/global/hooks.php ?>

<?php
//function to generate internal image, external image or video for content-blog.php, content-blog-single.php, and archive.php
//please find it in truethemes_framework/global/basic.php

$html = truethemes_generate_blog_image($image_src,$image_width,$image_height,$blog_image_frame,$linkpost,$permalink,$video_url);

echo $html;
?>

<?php limit_content(30, true, '');
get_template_part('theme-template-part-inline-editing','childtheme'); ?>
<a class="ka_button small_button" href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"><span><?php echo $ka_blogbutton; ?></span></a>
<?php if(function_exists('selfserv_shareaholic')) { selfserv_shareaholic(); } ?>

<?php if ($ka_post_date != "true"): ?>
<div class="post_date">
<span class="day"><?php the_time('j'); ?></span>
<br />
<span class="month"><?php echo strtoupper(get_the_time('M')); ?></span>
</div><!-- end post_date -->

<div class="post_comments">
<a href="<?php echo the_permalink().'#post-comments'; ?>"><span><?php comments_number('0', '1', '%'); ?></span></a>
</div><!-- end post_comments -->
<?php endif; ?>

<?php
global $post;
$post_title = get_the_title($post->ID);
$permalink = get_permalink($post->ID);
if ($ka_dragshare == "true"){ echo "<a class='post_share sharelink_small' href='$permalink' data-gal='prettySociable'>Share</a>"; }

?>


<?php truethemes_end_post_content_hook();// action hook, see truethemes_framework/global/hooks.php ?>

</div><!-- end post_content -->


<div class="post_footer">

<?php truethemes_begin_post_footer_hook();// action hook, see truethemes_framework/global/hooks.php ?>

<div class="post_cats"><p><span><?php _e('Categories:', 'truethemes_localize') ?></span> <?php the_category(', '); ?></p></div><!-- end post_cats -->

<?php if (get_the_tags()) : ?>
<div class="post_tags"><p><span><?php _e('Tags:', 'truethemes_localize') ?></span> <?php the_tags('', ', '); ?></p></div><!-- end post_tags -->
<?php endif; ?>

<?php truethemes_end_post_footer_hook();// action hook, see truethemes_framework/global/hooks.php ?>

</div><!-- end post_footer -->

</div><!-- end blog_wrap -->


<?php endwhile; else: ?>
<h2><?php _e('Nothing Found', 'truethemes_localize') ?></h2>
<p><?php _e('Sorry, it appears there is no content in this section.', 'truethemes_localize') ?></p>
<?php endif; ?>
<?php
if(function_exists('wp_pagenavi')) {
wp_pagenavi();
}else{
//not using this function, just for theme check plugin requirement.
//do not remove this..
paginate_links();
}
?>


Please point out what code needs to be removed/replaced to achieve this

This question has been answered.

attachment image asker uploaded image

tokenofhon | 02/05/13 at 4:30am Edit
Tutorial: How to assign prize money

Previous versions of this question: 02/06/13 at 12:17am | 02/06/13 at 1:54am

(17) Responses

See a threaded view of answers?

Warning: Please do not give out any FTP or ssh credentials to anyone, unless you trust them completely. Giving out login details is dangerous.

  • avatar
    Last edited:
    02/06/13
    2:17am
    Kiet Luong says:

    You should create new template file to achieve that instead of using iframe.
    If possible please contact with me on skype: kioluong

    Regards !

  • avatar
    Last edited:
    02/06/13
    2:41am
    Arnav Joy says:

    you do not need to create a new page , you can call page's specific areas with in iframe using style

    i did something similar in this question , please read it and let me know if it is ok with you too

    http://www.wpquestions.com/question/showChronoLoggedIn/id/7943

  • avatar
    Last edited:
    02/06/13
    2:21am
    tokenofhon says:

    the point of the iframes though is to display the 2 different blog pages on the same page (as the different pages have seperate category posts)

    creating a new template is for the actual blog pages (2) that are being placed in the iframes

  • avatar
    Last edited:
    02/06/13
    2:37am
    Kiet Luong says:

    you can use wordpress function

    <?php get_page( $page_id ) ?>
    to achieve what you want with


    Return Values
    (object|array)
    mixed Page data.
    [ID] => (integer)
    [post_author] => (integer)
    [post_date] => (YYYY-MM-DD HH:MM:SS)
    [post_date_gmt] => (YYYY-MM-DD HH:MM:SS)
    [post_content] => (all post content is in here)
    [post_title] => (Post Title Here)
    [post_excerpt] => (Post Excerpt)
    [post_status] => (? | publish)
    [comment_status] => (? | closed)
    [ping_status] => (? | closed)
    [post_password] => (blank if not specified)
    [post_name] => (slug-is-here)
    [to_ping] => (?)
    [pinged] => (?)
    [post_modified] => (YYYY-MM-DD HH:MM:SS)
    [post_modified_gmt] => (YYYY-MM-DD HH:MM:SS)
    [post_content_filtered] => (?)
    [post_parent] => (integer)
    [guid] => (a unique identifier that is not necessarily the URL to the Page)
    [menu_order] => (integer)
    [post_type] => (? | page)
    [post_mime_type] => ()?)
    [comment_count] => (integer)
    [ancestors] => (object|array)
    [filter] => (? | raw)


    More infomation here

  • avatar
    Last edited:
    02/06/13
    2:47am
    tokenofhon says:

    That could work, would you be able to provide something similar for my site? or can i just copy + paste from the other thread and swap the web address in the iframe

    Also, width and height % doesnt work in html 5 as far as im aware, so ill change it to pixels?

  • avatar
    Last edited:
    02/06/13
    2:55am
    tokenofhon says:

    i just tested applying your solution and this worked, however there is no scroll bar, how would i add that? (i tried scrolling="yes" in the iframe to no avail)

    Also, would it be possible to make it a little largere in width? i tried adjusting the width in style (up to 80% and 100%) however it only changes the viewing box size, rather than the content size.

  • avatar
    Last edited:
    02/06/13
    3:01am
    tokenofhon says:

    Sorry to triple post, just noticed it cuts down a little bit too far (missing first post)

  • avatar
    Last edited:
    02/06/13
    4:15am
    Arnav Joy says:

    can you show a screenshot of how you would like to have it?

    the link which i showed you is just for reference and not the actual solution you want , you have to adjust css to match the result you want.

  • avatar
    Last edited:
    02/06/13
    4:50am
    tokenofhon says:

    Here is screenshot 1, showing how id like it, with the default blog page in the first iframe, and the 2nd iframe containing the events category (this is just done via different http: addresses in iframe, they will both need to scroll down the equal distance to the first post.

    attachment image expert uploaded image

  • avatar
    Last edited:
    02/06/13
    4:51am
    tokenofhon says:

    here is screenshot 2, same thing but with the iframes being a bit wider (i would want them both wider, was just extending one to show width difference)

    The width isnt a big issue, getting them to scroll to the correct area is more important

    attachment image expert uploaded image

  • avatar
    Last edited:
    02/06/13
    4:55am
    tokenofhon says:

    Oh sorry, forgot to add the scrollbar into those images (scrollbar in iframes)

  • avatar
    Last edited:
    02/06/13
    5:01am
    Arnav Joy says:

    I have one question , if you want to integrate that feature then why you want to use iframe method because when any how you set it to fits with the design then when you click on read more button then it will open in the same iframe and that time its structure will be different and may not look good.

    if you want to show some posts from any category and some posts from other category then that can also be done via coding calling wp functions etc.. then that will open url in new window or same window as you want .

    let me know if you understood what i want to say and what is your opinion about it.

  • avatar
    Last edited:
    02/06/13
    5:30am
    tokenofhon says:

    Because the person im doing this for wants to have the 2 scrollable areas with the seperate blog categories in each

    I only knew how to do this via iframes, if it is possible to split up the blog into showing only posts from each category into scrollable boxes on the SAME page then that would be much better

    if not then iframe is the only solution for what they want (i understand clicking "read more" makes it look strange)

  • avatar
    Last edited:
    02/06/13
    5:47am
    tokenofhon says:

    ive gotten it working how i want in the iframes thanks to your advice

    see http://www.strausshosting.com.au/~energeti/testing/

    except for one thing, the scrollbar; its too high up and doesnt appear until you scroll down a bit, is there a way to force the scrollbar down, so its showing straight away?

    Also, if you know how to do it the way you suggested that would be better; thanks for all your help so far mate

  • avatar
    Last edited:
    02/06/13
    5:52am
    Arnav Joy says:

    which scrollbar are you talking about page or iframe ? because i have not see any scrollbar in iframe area..

    yes there is a way to show it without iframe method ..

  • avatar
    Last edited:
    02/06/13
    6:04am
    tokenofhon says:

    is there a way to add a scrollbar to the iframe?


    apart from that i'm talking about the scrollbar of the pages that are inside the iframes, their scrollbar comes into vision when you use the mouses scrollwheel to go down

  • avatar
    Last edited:
    02/06/13
    2:26pm
    Kiet Luong says:

    The best way is create new template file use wordpress function to shown content and use css to style.

This question has expired.



Arnav Joy had additional discourse to offer.

Gabriel Reguly, Francisco Javier Carazo Gil, tokenofhon voted on this question.



Current status of this question: Completed



Please log in to add additional discourse to this page.





Warning: Please do not give out any FTP or ssh credentials to anyone, unless you trust them completely. Giving out login details is dangerous.

If the asker does not get an answer then they have 10 days to request a refund.