get_username
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Setting “Posts Page” default no longer displays featured imageAfter many searches, guessing at what to search for, this solution works. I’d like if someone could check my logic. Is this the expected way to handle custom background images and custom fields on the Posts Page?
For the background “Featured Image” on the Blog home page.
<?php if (is_home()) { $hero = wp_get_attachment_image_url( get_post_thumbnail_id(get_option('page_for_posts')), 'full' ); } else { $hero = wp_get_attachment_image_url( get_post_thumbnail_id($post->ID), 'full' ); } ?>
For the custom fields on the Blog home page.
<?php if (is_home()) { the_field('header_headline', get_option('page_for_posts')); } else { the_field('header_headline'); } ?>
Could I have done this differently? Is there a standard? Thanks!
Forum: Fixing WordPress
In reply to: Setting “Posts Page” default no longer displays featured imageI just came across a post with this interesting code snippet.
<?php if(is_home()) { $img = wp_get_attachment_image_src(get_post_thumbnail_id(get_option('page_for_posts')),'full'); $featured_image = $img[0]; }?>
It looks like it gets the ID of the page you set under “Reading Settings.” I haven’t tested yet, but looks promising. I assume I would set the condition based on is_page(‘blog’) instead of home?
Forum: Fixing WordPress
In reply to: Setting “Posts Page” default no longer displays featured imageIt appears that using a template for blog posts is incorrect as pointed out here. I am setting all of my header background images in header.php, so I’m not sure how template hierarchy plays out here. If I use index.php or home.php they are still pulling from the same header.php file.
Forum: Fixing WordPress
In reply to: Setting “Posts Page” default no longer displays featured imageThanks for the reply. I hadn’t thought about the other pages that this would happen on such as category.php, tag.php, archive.php, etc. I wonder if I’m approaching this correctly? Without hardcoding the “background-image” is there another way to loop into the featured image? I’m not sure what the more specific query is that you’re referring to. Do I need a custom template for my “blog” page or would that not work either because, like you said, there are other pages like archive.php. Thanks for any additional help you can provide.
-Burt
Forum: Fixing WordPress
In reply to: Responsive NavigationHey David,
I think there is some confusion around the drop-down. I don’t need jQuery for my drop-down menus as they are all CSS driven. I was referring to using jQuery for the mobile navigation.
I’m pretty solid when it comes to html and css, and I understand drop-downs, but every post I read about responsive navigation has some sort of JS or jQuery involved.
Forum: Fixing WordPress
In reply to: Responsive NavigationI’m beginning to think you’re right, David. The more I read, the more I realize I need to learn more. While I know what a media query does, I think understanding how to position things with them will help.
Forum: Fixing WordPress
In reply to: Responsive NavigationI think another thing that is throwing me off is the drop-down menu. Having just buttons without the drop-down makes more sense. I wonder if I’m over thinking it. Does having a drop-down just require an additional click that is similar to the mobile “menu” button?
Forum: Fixing WordPress
In reply to: Responsive NavigationThanks again, David. I understand media queries more than I understand the implementation of these menus. I’ve built my own responsive framework from the ground up, so I feel comfortable using media queries. Maybe I’m missing your point, and I apologize for that. I will definitely read more into that article as a refresher.
I’ve created my basic CSS drop-down nav, but have not created the mobile version yet. What I’m struggling with is the implementation of JQuery to get the menu to work correctly. Especially, the drop-down in mobile view, and reveling the menu on click.
If I break down what you’re saying, it sounds like I need to get my menus working in standard view – which I have already – then mobile view. And getting these to display correctly using my media queries. Once those are set, worry about the JQuery and how it animates the menu. Correct me if I’m wrong.
Forum: Fixing WordPress
In reply to: Responsive NavigationSomething like this, but with drop-down and WordPress support.
Forum: Fixing WordPress
In reply to: Responsive NavigationThanks, David. I’m actually pretty familiar with the “ins and outs” of digesting code. I constantly study other people’s code as well. So the problem isn’t in my ability to find code.
I’ll take a closer look at that second link, but I’m still hoping to find a step-by-step so that I can understand how to create a menu instead of just coping another theme. I’m trying to go beyond being a hacker, and actually learn. ??
Forum: Fixing WordPress
In reply to: Curious Code Appeard In Function FileThanks, WPyogi. These resources are very helpful. I appreciate the reply. The site seems to work after removing that rogue code, but I will definitely run a full scan.
Forum: Fixing WordPress
In reply to: Custom taxonomy template not showingHey Steven. I agree my nomenclature could have been a little better, and I have a page called Testimonials to add to that.
From what I can see, I have a post type label named Testimonials(plural) and Testimonial(singular). The actual post type name is “clientfeedback”. My taxonomy is called “testimonial.”
Clear as mud, right? I can get my posts to show on my Testimonials page, it’s the taxonomy link that does not work. So I believe I do need the taxonomy page. It’s the same as when you click on a category link when browsing a standard blog. You click the category that the post is associated with, and you’re taken to /category/%postname%. In my case, I’m looking for /taxonomy/%postname%.
UPDATE: After posting this question on another forum, someone mentioned that I needed to re-save my permalinks again. I did this, and so far this has worked. A little more testing is needed, but I think this might have been part of a problem I was not even aware of. Has anyone heard of this? Where does WordPress documentation state that you need to “save permalinks after creating a custom taxonomy?”
Forum: Fixing WordPress
In reply to: Custom taxonomy template not showingI should also note that this is the code I’m using to bring up custom taxonomy link.
<?php the_terms( $post->ID, 'testimonial', '<strong>Posted in:</strong> ', ', ', ' ' ); ?>
Could this have anything to do with it?
Forum: Themes and Templates
In reply to: Category & Tag template best practicesThanks, RoseAndMoon, I’ve tried what they mentioned in that post. I have taxonomy-testimonial.php as my template, but it skips right to the index.php file. My registered taxonomy is of course “testimonial.”
Forum: Fixing WordPress
In reply to: Custom taxonomy template not showingHere is my code if you think that will help. Any ideas you might have is greatly appreciated. This is the last portion of the site and then I’m done.
// testimonial custom content type add_action('init', 'testimonial_register'); function testimonial_register() { $labels = array( 'name' => _x('Testimonials', 'post type general name'), 'singular_name' => _x('Testimonial', 'post type singular name'), 'add_new' => _x('Add New', 'testimonial item'), 'all_items' => __('All Testimonials'), 'add_new_item' => __('Add New Testimonial'), 'edit_item' => __('Edit Testimonial'), 'new_item' => __('New Testimonial'), 'view_item' => __('View Testimonial'), 'search_items' => __('Search Testimonials'), 'not_found' => __('Nothing found'), 'not_found_in_trash' => __('Nothing found in Trash'), 'parent_item_colon' => '' ); $args = array( 'labels' => $labels, 'public' => true, 'publicly_queryable' => true, 'show_ui' => true, 'query_var' => true, 'rewrite' => true, 'capability_type' => 'post', 'hierarchical' => false, 'menu_position' => 6, 'supports' => array('title','editor','thumbnail'), 'has_archive' => true ); register_post_type( 'clientfeedback' , $args ); } ?> <?php // testimonial custom taxonomy add_action('init', 'testimonial_taxonomies', 0); function testimonial_taxonomies() { $labels = array( 'name' => _x( 'Testimonial Types', 'taxonomy general name' ), 'singular_name' => _x( 'Testimonial Type', 'taxonomy singular name' ), 'search_items' => __( 'Search Testimonial Types' ), 'all_items' => __( 'All Testimonial Types' ), 'parent_item' => __( 'Parent Testimonial Type' ), 'parent_item_colon' => __( 'Parent Testimonial Type:' ), 'edit_item' => __( 'Edit Testimonial Type' ), 'update_item' => __( 'Update Testimonial Type' ), 'add_new_item' => __( 'Add New Testimonial Type' ), 'new_item_name' => __( 'New Testimonial Type Name' ), 'menu_name' => __( 'Testimonial Types' ), ); register_taxonomy( 'testimonial', // internal name = machine-readable taxonomy name 'clientfeedback', // object type = post, page, link, or custom post-type array( 'hierarchical' => true, // true for hierarchical like cats, false for flat like tags 'labels' => $labels, // the human-readable taxonomy name 'query_var' => true, // enable taxonomy-specific querying 'rewrite' => true // pretty permalinks for your taxonomy? )); } ?>