Kailey (trepmal)
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Getting post thumbnail URLglad you got things working out
Forum: Fixing WordPress
In reply to: Getting post thumbnail URLoops, I forgot to specificially mention that
thumbnail_size
should be the name of the thumbnail size you’re using (I think the default is ‘post-thumbnail’?) – did you try swapping that out?Here is where the
the_post_thumbnail()
function is defined, you might be able to follow the trail: https://phpxref.com/xref/wordpress/wp-includes/post-thumbnail-template.php.source.html#l40Forum: Fixing WordPress
In reply to: Getting post thumbnail URLMaybe this then?
<?php $thumb = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'thumbnail_size' ); $url = $thumb['0']; ?>
https://codex.www.ads-software.com/Function_Reference/wp_get_attachment_image_src
Forum: Fixing WordPress
In reply to: Next Page Previous Page helpHere’s a zipped copy of my modified version: https://cl.ly/2Qxp
Obviously, you’ll want to take into account any customization…
My index.php page looks like this:
<?php /* Template Name: Index */ ?> <?php get_header(); ?> <!-- Maincontent start --> <div id="maincontent"> <h2>Posts</h2> <?php query_posts("showposts=10&paged=$paged"); while (have_posts()) : the_post(); ?> <div class="post"> <h3><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent lenke til: <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h3> <div class="date"><?php the_date(); ?> <?php the_time(); ?></div> <?php the_content(''); ?> <div class="postmeta"> <span class="left"><?php if (function_exists('the_tags')) the_tags('Tags: '); ?></span> <span class="right"><?php comments_popup_link('No Comments', '1 Comment', '% Comments', 'comments'); ?></span> </div> </div> <?php endwhile; ?> <?php // if (is_paged()) : ?> <div id="pagination" class="clear"> <span class="left" ><?php posts_nav_link(' ','« Back',' ') ?></span> <span class="right" ><?php posts_nav_link(' ',' ','More »') ?></span> </div> <?php // endif; ?> </div> <!-- Maincontent end --> <?php get_sidebar(); ?> <?php get_footer(); ?>
I think the main change was commenting out the
is_paged()
check<?php // if (is_paged()) : ?> <div id="pagination" class="clear"> <span class="left" ><?php posts_nav_link(' ','« Back',' ') ?></span> <span class="right" ><?php posts_nav_link(' ',' ','More »') ?></span> </div> <?php // endif; ?>
Forum: Fixing WordPress
In reply to: Display first name in specific posts which contain a custom fieldSorry, I think I was up too late trying to answer questions… ??
Maybe this:
function twentyten_posted_on() { printf( __( '<span class="%1$s">Posted on</span> %2$s <span class="meta-sep">by</span> %3$s', 'twentyten' ), 'meta-prep meta-prep-author', sprintf( '<a href="%1$s" title="%2$s" rel="bookmark"><span class="entry-date">%3$s</span></a>', get_permalink(), esc_attr( get_the_time() ), get_the_date() ), sprintf( '<span class="author vcard"><a class="url fn n" href="%1$s" title="%2$s">%3$s</a></span>', get_author_posts_url( get_the_author_meta( 'ID' ) ), sprintf( esc_attr__( 'View all posts by %s', 'twentyten' ), get_the_author() ), get_the_author_meta('first_name') ) ); }
If that doesn’t work, my guess would be that the author-related functions aren’t getting the author ID to work with… I might find a way to pass it the id
function twentyten_posted_on( $id ) { printf( __( '<span class="%1$s">Posted on</span> %2$s <span class="meta-sep">by</span> %3$s', 'twentyten' ), 'meta-prep meta-prep-author', sprintf( '<a href="%1$s" title="%2$s" rel="bookmark"><span class="entry-date">%3$s</span></a>', get_permalink(), esc_attr( get_the_time() ), get_the_date() ), sprintf( '<span class="author vcard"><a class="url fn n" href="%1$s" title="%2$s">%3$s</a></span>', get_author_posts_url( $id ), sprintf( esc_attr__( 'View all posts by %s', 'twentyten' ), get_the_author() ), get_the_author_meta('first_name', $id) ) ); }
and when the function is called,
twentyten_posted_on( get_the_author_meta( 'ID' ) );
Forum: Fixing WordPress
In reply to: Log Out Problemglad to hear it!
mind setting this topic to resolved? thanks
Forum: Fixing WordPress
In reply to: Can I change background color in Visual Editor?glad to hear you got things working
If you can figure out why my method wasn’t working, I’d be interested to know what the reason was…
Forum: Fixing WordPress
In reply to: Can I change background color in Visual Editor?Hmmm… I was able to tweak that file via Firebug and change the background color, font color and family. Perhaps your browser was caching the styles?
Here’s a copy of my Firebug-ged stylesheet: https://cl.ly/2QOx
Forum: Fixing WordPress
In reply to: Why does every image have some padding below it?try adding this to your stylesheet:
img { display:block; }
I think that’ll fix the problem you’re describing, though you may have to make some other changes to compensate for the display change…
Forum: Fixing WordPress
In reply to: posting my blog to facebook and twitterThere are several plugins to help with tweeting your posts, like https://www.ads-software.com/extend/plugins/wp-to-twitter/
I haven’t imported a blog to Facebook in a while, but these instructions look right: https://www.askdavetaylor.com/how_do_i_import_my_blog_entries_or_rss_feed_into_facebook.html
Forum: Fixing WordPress
In reply to: Redirecting old URL posts to new URL postsI think what you want is something like this:
RewriteEngine ON RewriteRule ^(.*)$ https://mynewdomain.com/$1 [R=301,L]
You can learn more here: https://www.gnc-web-creations.com/301-redirect.htm
Forum: Fixing WordPress
In reply to: Changing Font size and Colorthe basic idea would be to add something like this to your stylesheet:
#content { font-size:14px; color:green; }
obviously, change the values to suit your needs, and the selector (#content) as needed to target the right part of your page.
If the trouble is targeting one page over another, change (or add to) the
<body>
tag so it looks like this<body <?php body_class(); ?>>
. This will add some page-specific classes so you can do things like:.home #content {}
Forum: Fixing WordPress
In reply to: Getting post thumbnail URLI haven’t tested this, but you might be able to use this (or something like it…):
$url = wp_get_attachment_url( get_post_thumbnail_id($post->ID) ); <img src="<?php echo $url; ?>" longdesc="URL_2" alt="Text_2" />
https://codex.www.ads-software.com/Function_Reference/get_post_thumbnail_id
https://codex.www.ads-software.com/Function_Reference/wp_get_attachment_urlForum: Fixing WordPress
In reply to: thumbnails won't showIs
if ( has_post_thumbnail() ) { the_post_thumbnail( 'helio_slider', array('class' => 'slidimg') ); }
being called within the loop?
If not, try this:
if ( has_post_thumbnail( $post->ID ) ) { echo get_the_post_thumbnail( $post->ID, 'helio_slider', array('class' => 'slidimg') ); }
Forum: Fixing WordPress
In reply to: Strange ProblemJust some ideas…
Since you reinstalled WordPress, I presume the core files are fine. That leaves me with these 2 questions:* have you double-checked the template files?
* have you’ve looked through the database tables to make sure they’re okay?