Forum Replies Created

Viewing 15 replies - 121 through 135 (of 268 total)
  • Find wherever the sidebar code is in the template_posts file, and then you want to use the is_page() function instead of is_page_template() function. It would look something like this:

    <?php
    if ( is_page( /*page ID, slug, etc. goes here*/ ) ) {
       get_sidebar( 'secondary_sidebar1' ); }
    elseif ( is_page( /* page ID, slug, etc. */ ) ) {
       get_sidebar( 'secondary_sidebar2' ); }
    else {
       get_sidebar( 'main_sidebar' ); }
    ?>

    I would recommend finding some way to test for fullwidth setting first, and then running the code above for every page that is not fullwidth.

    In what file did you put the code that you posted? The “where” is probably most of your problem.

    Based on what you’re describing, you don’t need the if statements at all. Because the pages are using specific templates, you already know whether it’s being used or not. So yo would put the functions for the sidebar directly in your page template at the appropriate place, and then call the sidebar that you want to call. When it comes to your full-width page, then don’t put any sidebar at all, and make sure to adjust your CSS to widen the content. And then you have a general template for all the other pages that calls the main sidebar.

    Does that make sense?

    @phidahl if you use the code tags, then your <p> and <br> don’t get parsed in these forums.

    In WordPress, you don’t need to add <p> and <br> tags. Just separate paragraphs by a double-return. When the post is parsed, WordPress should automatically include the <p> tags for you.

    Could you give an actual example you have encountered of your tags that are gone?

    If you want to, you could disable the visual editor in your profile settings within WordPress, so that there’s no switching back and forth.

    This is actually expected behavior, not a problem. HTML view shows tags, while the Visual mode does not. Visual mode renders as closely as possible to how it will display on the webpage itself. The tags aren’t stripped, they’re incorporated into the markup that is rendered for Visual mode.

    If you want to view the HTML markup, use the HTML mode. If you don’t want to see it and want to edit your post like a Word Processor, then switch to Visual.

    Based on the information you’re giving, I don’t think that the problem is with the code that is calling the header file. For the record, the correct call should be this:

    get_header( 'blog' );

    I think that the problem is actually that the template file that calls that code in the first place isn’t being read. The file should be named “page-blog.php”, not “blog-page.php”.

    Another option would be to include the following code in a comment at the very beginning of the file:

    /**
     * Template Name: Blog
     */

    Once this code has been included, you can specifically select this template to be used on your page. This setting is when you’re editing the content of your page.

    In case you didn’t already know, you can tie into the header code from (just about) anywhere by adding an action. Your code in the “single-5.php” file would be this:

    <?php
    add_action( 'wp-head', 'single-5-style' );
    function single-5-style { ?>
       <link rel="stylesheet" href="<?php bloginfo( 'template_url' ); ?>/css/customerCare.css">
       <?php
    }

    Check out the is_page() function reference. That function isn’t looking for a php file name. It’s looking for an ID, a slug, a title, or an array of any of those. So if your page has an ID of 5, you’d want to use is_page( 5 );.

    While removing the get_footer() function will technically work, it is definitely not a good idea, as the footer also typically includes other things such as the closing tags for <body> and <html>, not to mention various other WordPress functions.

    It’s best to post the link to your site as @esmi recommends. It may even be beneficial to post the code to your footer.php file found in http://www.yoursite.com/wp-content/themes/<yourthemename>/footer.php. Make sure to use the WordPress Pastebin if the code is longer than a dozen or so lines.

    You may be able to do something like this (but I haven’t tested it to see if it will actually work):

    function custom_excerpt_length( $length ) {
       if ( is_page( /*Page ID goes here*/ ) ) {
          return 20;
       }
    }
    add_filter( 'excerpt_length', 'custom_excerpt_length', 999 );

    You must have found the correct css change of float: right instead of float: left, as it appears that your sidebar is now displaying the same as on your home page.

    Since your code was removed by a moderator, please post your code to a pastebin, and share the link here. It would also be helpful to give a pure HTML example of what you’re currently getting compared to the end result you want to achieve.

    When I look at your site, the body text is black, not gray. This is confirmed by analyzing the computed style in Safari.

    Perhaps it’s because the font you’re using is very thin? A thin font can give the appearance of being lighter in color than it actually is.

    Perhaps a silly question… are you sure that you have posts and not just pages? And that they actually have an image attached?

    Did you try turning on any of the check boxes for the thumbnail? Such as “Get first image of post” or “Get first attached image of post”?

Viewing 15 replies - 121 through 135 (of 268 total)