Forum Replies Created

Viewing 13 replies - 16 through 28 (of 28 total)
  • I need this too ??

    Thread Starter ciaravino

    (@ciaravino)

    Even if I manually put a page id instead of $post->ID, it doesn’t work…

    Is my loop wrong? I don’t know why the_meta would work and get_post_meta wouldn’t if they are both used at the same point.

    Thread Starter ciaravino

    (@ciaravino)

    I tried that before but it didn’t work either ??

    Thread Starter ciaravino

    (@ciaravino)

    Here’s the complete code… I don’t GET IT! ?? I’ve been looking for like 5 hours straight and I get how it should work, I just must have like 1 little thing wrong… the_meta() works fine and displays all the keys and values but if I try to get just one key and value with get_post_meta, nothing shows up. I’ve tried calling a few of the custom field keys, none come up.

    <?php get_header(); ?>
    <article>
    	<div class="blog-article">
    		<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    		<section>
    			<div class="post" id="post-<?php the_ID(); ?>">
    				<header>
    					<h1 class="post-title">
    						<?php the_title(); ?>
    					</h1>
    				</header>
    				<section>
    					<?php get_post_meta($post->ID, 'title', true); ?>
    				</section>
    
    			</div>
    		</section>
    		<section>
    			<?php the_content(); ?>
    		</section>
    	</div>
    	<?php endwhile; endif; ?>
    </article>
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>

    The reason I don’t want to use the_meta is because I need to have the keys/values in a certain order and kinda scattered… I want to be able to call each individual one with get_post_meta, for example:

    <ul>
    <li><?php get_post_meta($post->ID, 'title', true); ?></li>
    <li><?php get_post_meta($post->ID, 'next', true); ?></li>
    <li><?php get_post_meta($post->ID, 'other', true); ?></li>
    <li><?php get_post_meta($post->ID, 'etc', true); ?></li>
    </ul>
    
    <div>
    <?php get_post_meta($post->ID, 'something', true); ?>
    </div>

    Thread Starter ciaravino

    (@ciaravino)

    I tried that, it didn’t work :(. I found the solution though.

    get_posts(tag=) gets the tag’s slug, not the actual tag. So, I needed to get the page’s slug, not the page’s title.

    Instead of wp_title() I use basename(get_permalink()); to get the page’s slug.

    Thanks :D!

    Thread Starter ciaravino

    (@ciaravino)

    I think the problem may be that get_posts(tag=) gets the tag’s slug, so I need to get the page’s slug, not the title? I don’t know how to get the page’s slug, but I’m looking.

    Thread Starter ciaravino

    (@ciaravino)

    That didn’t change anything on the page (nothing was added or subtracted).

    When I use the_title() instead of wp_title(”,false,”) it displays the 5 most recent posts (but they aren’t filtered by tag).

    Also, when I echo $myposts, the only thing that gets displayed is the word “Array”. Should it also have each post as an array item at that point?

    Here’s the code:

    <?php $page_title = wp_title('',false,''); ?>
    <ul>
    <?php
    global $post;
    $myposts = get_posts('posts_per_page=5&tag=' . $page_title);
    echo $myposts;
    foreach($myposts as $post) :
    	setup_postdata($post);
    ?>
    	<li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
    <?php endforeach; ?>

    The only thing that is displaying is the word “Array”.

    Thread Starter ciaravino

    (@ciaravino)

    Thanks for replying, I have no idea how to accomplish this ?? I tried your code, but how I’m doing it doesn’t work. Here’s how I’m using it:

    <article>
    	<div class="blog-article">
    		<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    		<section>
    			<div class="post" id="post-<?php the_ID(); ?>">
    				<header>
    					<h1 id="page-list-header">
    						<?php the_title(); ?>
    					</h1>
    				</header>
    			</div>
    		</section>
    		<section>
    			<?php the_content(); ?>
    		</section>
    		<?php endwhile; endif; ?>
    
    		<?php $page_title = wp_title('',false,'');?>
    		<ul>
    		<?php
    		global $post;
    		$myposts = get_posts('posts_per_page=5&tag=' . $page_title);
    		foreach($myposts as $post) :
    			setup_postdata($post);
    		?>
    			<li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
    		<?php endforeach; ?>
    		</ul>

    Nothing shows up for that area of code.

    IE 7 could possibly handle widths borders different than all other browsers, I forget. You may have to make a conditional statement that takes a couple of pixels from the width of the element.

    Yeah, I see grid-wrapper isn’t inside single-wrapper. If you are able to edit that file, find where <div id=”grid-wrapper”> starts and add class=”hidden” to it, so it would come out to:

    <div id="grid-wrapper" class="hidden">

    Then in your CSS put:

    .hidden {display: none;}

    I didn’t really read the code but if I understand correctly, you should be able to hide it with CSS (assuming the grid-wrapper div is inside the single-wrapper div):

    #single-wrapper #grid-wrapper {display: none;}

    and if that doesn’t work, try:

    #single-wrapper>#grid-wrapper {display: none;}

    Put them in your CSS file.

    Thread Starter ciaravino

    (@ciaravino)

    Oh my god…….. Thank you so much! I’ve spent so much time trying to figure it out… I’ll post the fix on the other forums I posted on so people can see the problem in case they ever get the problem.

    Thanks again!

    Thread Starter ciaravino

    (@ciaravino)

    Sorry, I removed that head while troubleshooting it, but I forgot to put it back in. That didn’t make any difference. I just noticed that the :hovers in the sidebar section of the recipes and stuff don’t work on drlapiana.com/blog, but they work on drlapiana.com. That may have something to do with it.

Viewing 13 replies - 16 through 28 (of 28 total)