Custom field not showing

Because you’re in The Loop, you shouldn’t need to use get_the_ID(). Does this: <div class=”latest”> <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> <div class=”boxes”> <?php echo “<p>”.the_meta().”</p>”; ?> <a href=”https://wordpress.stackexchange.com/questions/109423/<?php echo get_post_meta($post->ID,”promotional_link’, true); ?>”> <?php //var_dump($show); ?> <img src=”<?php echo get_post_meta( $post->ID, ‘promotional_image’, true); ?>” height=”200″ width=”260″> </a> </div><!–boxes–> … Read more

How to handle parent and child pages?

Problem 2: displaying the 3 panels. Do I set these up as individual children elements? If so, how can I style each one differently as it loops through? There are only 3 items. Don’t loop through them. Use get_posts() to place them in an array and then step through each array item: $panels = get_posts( … Read more

Best hook for a function which adds shortcodes to the system?

If I’m following things correctly, I think the problem is that your shortcode callback echoes, rather than returns its content – and that you have it set up that way in order for the shortcode content to output outside of the post content. If that’s the case, you’re taking the wrong approach. Your shortcode callback … Read more

the_content() “crashes” for single pages

the_content( ); vs get_the_content(); The different is pretty simple actually. If you find yourself annoyed with formatting of the content, more specifically the added p-tags that WordPress puts into the content that you didn’t. Just use get_the_content(); and you will remove those tags. Normally the get_the_content() tag returns the content WITHOUT formatting. Only the_content() will … Read more

repeating posts on 2nd page to posts

Use this in your child themes functions.php file add_action( ‘pre_get_posts’, ‘exclude_category_posts’ ); function exclude_category_posts( $query ) { if( $query->is_main_query() && $query->is_home() ) { $query->set( ‘cat’, ‘-27,-30′ ); } } Add a comma separated list of category i.d’s to the set. Never Use Query Posts

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)