Jeremy Pry
Forum Replies Created
-
Forum: Themes and Templates
In reply to: Adding Multiple Sidebars to Studio ThemeFind wherever the sidebar code is in the template_posts file, and then you want to use the
is_page()function instead ofis_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.
Forum: Themes and Templates
In reply to: Adding Multiple Sidebars to Studio ThemeIn 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?
Forum: Themes and Templates
In reply to: Post editor strips tags when switching between HTML and Visual@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.Forum: Themes and Templates
In reply to: Post editor strips tags when switching between HTML and VisualCould 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.
Forum: Themes and Templates
In reply to: Post editor strips tags when switching between HTML and VisualThis 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.
Forum: Themes and Templates
In reply to: New header using get_header( $name); not workingBased 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.
Forum: Themes and Templates
In reply to: Linking to custom CSS fileIn 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 }Forum: Themes and Templates
In reply to: Linking to custom CSS fileCheck 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 );.Forum: Themes and Templates
In reply to: How to remove text from footerWhile 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.Forum: Themes and Templates
In reply to: custom length excerpt in one template onlyYou 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 );Forum: Fixing WordPress
In reply to: Sidebar moved to bottom of the page on single postYou must have found the correct css change of
float: rightinstead offloat: left, as it appears that your sidebar is now displaying the same as on your home page.Forum: Themes and Templates
In reply to: remove classes from nav_menu itemsSince 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.
Forum: Themes and Templates
In reply to: font colors differ in CSS, help!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.
Forum: Themes and Templates
In reply to: white border around custom logoPerhaps a silly question… are you sure that you have posts and not just pages? And that they actually have an image attached?
Forum: Themes and Templates
In reply to: white border around custom logoDid 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”?