justin.garner23
Forum Replies Created
-
Forum: Developing with WordPress
In reply to: Block Theme Author Template@bcworkz, I’m referring to displaying custom meta on the front end, on the author page template.
For example: My classic theme added fields to the user profile page via ACF. Those fields get stored in the
wp_usermeta
table asexample_field
. Inauthor.php
I could useget_user_meta( 'example_field', $author_id );
to access the value and use it in the template.Now, I know that this isn’t the place for ACF support and I’m not seeking help with getting ACF field data exclusively. If I were to add custom values as you suggested, using
insert_user_meta
, I’d want to be able to access those values directly, too.As a temporary solution, I’ve decided that a hybrid approach is going to be necessary (for my case) until I’m able to learn more about the block based approach. Going this route I’m able to access all the data I’m needing and still take a block-forward approach to development.
Forum: Developing with WordPress
In reply to: Block Theme Author TemplateThanks for the quick response @t-p!
How does one go about adding author meta, though? I didn’t see anything about accessing any of the other meta users add to their profile that we’ve traditionally been able to add to author templates, like outlined here: https://codex.www.ads-software.com/Author_Templates#Using_Author_Information
Forum: Fixing WordPress
In reply to: Calling Post Titles & ImagesOK! New update. Figured it all out! The code below did exactly what I was wanting. When I finish the site I’ll come back and link to it so you can see what I was going for.
<div class="row-fluid"> <ul class="thumbnails"> <?php $popular = new WP_Query('orderby=comment_count&posts_per_page=4'); ?> <?php while ($popular->have_posts()) : $popular->the_post(); ?> <li class="span3"> <a href="<?php the_permalink() ?>" class="thumbnail"> <?php the_post_thumbnail(array(300,250)); ?> <h3 class="caption text-center"><?php the_title();?></h3> </a> </li> <?php endwhile; ?> </ul> </div>
Forum: Fixing WordPress
In reply to: Calling Post Titles & ImagesOh and I just thought I’d add that when I’ve worked through getting this up and running I intend to publish it to the WP theme directory. I don’t plan on using this theme to make money, I want to spread it and see what kind of awesomeness can be made with it!
Forum: Fixing WordPress
In reply to: Calling Post Titles & ImagesUpdate:
Thanks again for the response! I made a few changes to my code:
<?php query_posts("post_per_page=6"); the_post(); ?> <li class="span2"> <a href="<?php the_permalink();?>" class="thumbnail"> <img src="https://placehold.it/300x250&text=placeholder"> <h4 class="caption text-center"><?php the_title();?></h4> </a> </li>
Now I’m pulling the link and title! I’m almost where I’d like to be, just lacking the image from the post. I’m reading and researching in hopes of figuring it out (and learning more along the way!), but if anybody happens to know the route I need to take, it would be much appreciated.
Forum: Fixing WordPress
In reply to: Calling Post Titles & ImagesIt’s actually a theme I’m building myself, based off Bootstrap. Here’s the code for one of my rows:
<div class="row-fluid"> <ul class="thumbnails"> <li class="span3"> <a href="#" class="thumbnail"> <img src="https://placehold.it/300x250&text=placeholder"> <h4 class="text-center">category</h4> </a> </li> </ul> </div>
I’d like the link to be a link to the post, the image to an image pulled from that post and the h4 to be the title.
Thanks for the quick response!