Kerosity
Forum Replies Created
-
Forum: Plugins
In reply to: [WooCommerce] How to list specific products on a page or page template?Hey thanks for the response!
I did see the shortcode, but is there a way to do it with code in the template file?
Because if we used a shortcode, we’d have to have something that auto-generated the shortcode after having some type of selector that we use to choose which products to display. Right?
Forum: Fixing WordPress
In reply to: Image Cropper Not Working Every time?I found a plugin that does something better than what I was looking for.
Forum: Plugins
In reply to: [W3 Total Cache] Can't Install Without White Screen^
By chance did you trouble shoot and solve this one? I have a Yoothemes template also and I’d really like to get your plugin working on my site. They all run off of the same framework so it should be a very similar fix.
Forum: Fixing WordPress
In reply to: If Parent Page > First Child, If Child > Show Next ChildAny assistance?
Forum: Fixing WordPress
In reply to: Commenter Avatar Choice From Select BoxAny input?
Forum: Fixing WordPress
In reply to: What makes Menu CSS Classes print to html?Okay I read up a little bit more on the walker class. “I think” I understand it enough to say I’m not using it.
When I registered my menu I just used the theme_location and nothing else.
Forum: Fixing WordPress
In reply to: What makes Menu CSS Classes print to html?I’ve never heard of a custom menu walker until I started searching for a solution to this problem. I tried reading the docs for the menu walkers but I didn’t fully understand them. (I’m learning PHP/Wordpress as I go – pretty new to it all.)
The only thing I did was follow a guide to create the menu and register it in the functions.php
So I probably went about 6 pages deep on google searches for the debug notice I got above… after trying (trial/error) a dozen different things… this seems to work:
<?php global $post; if( $post->post_parent ) { ?> <a href="<?php get_permalink( $post->post_parent ); ?>"><?php echo get_the_title( $post->post_parent ); ?></a> <?php } else { the_title(); } ?>
All that I did was add
global $post;
before.Can someone explain what is going on so I can know what I’m doing in the future… lol.
First off, thanks a ton for all of your help. I really appreciate it!
This is a custom page template that I’m going to be using for about 40-50 pieces of content on my site (and possibly go from there). So I do want it to be different then the rest of the site, but I used a custom template so I can just easily select it while creating the page/child-pages. (I’m not wrong with this line of thinking am I?)
-edit- And since I’m using the Warp Framework, it’s very funky how you have to create custom page templates, which is why the pastebin I linked above has all that extra code.
There’s a lot more going on! Basically what I did so far was take their “template” file and edit it down to where it’s just displaying the header/footer. Then I was going to put my page template code in the middle.
The stuff I’m entering starts at line #112
Okay! I turned on the debug mode (that’s really cool!).
I get this error on both lines where
$post->post_parent
exists.Here’s the error:
Notice: Undefined variable: post in /file/path/to/template.php on line 116
Notice: Trying to get property of non-object in /file/path/to/template.php on line 116
Notice: Undefined variable: post in /file/path/to/template.php on line 118
Notice: Trying to get property of non-object in /file/path/to/template.php on line 118
I’m using a WordPress Framework (Yootheme’s Warp v6) so I’m assuming this has something to do with it…
-edit- nevermind… still trying to figure it out.
Okay started debugging:
When I put your line of code before it, It displayed “Parent: ” “
So then I looked into the loop link you sent. If I’m reading it right I should wrap my “post content” with this:
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> ~post content here~ <?php endwhile; else: ?> <p><?php _e('Sorry, no posts matched your criteria.'); ?></p> <?php endif; ?>
Right? I wrapped the previous code in that and it I get the same results.
I put that into the second line of what alchymyth suggest right?
If so that didn’t seem to work either.