Get simple field value with post id
The function second parameter is the “$post_id”. Ref. http://simple-fields.com/documentation/api/getting-values/simple_fields_value/ simple_fields_value(“simple_field_slug”, $post_id)
The function second parameter is the “$post_id”. Ref. http://simple-fields.com/documentation/api/getting-values/simple_fields_value/ simple_fields_value(“simple_field_slug”, $post_id)
Figured it out 🙂 It ends up the Smarter Navigation plugin has a few other functions that I missed: https://plugins.trac.wordpress.org/browser/smarter-navigation/trunk/template-tags.php I used get_adjacent_id_smart() like so: <?php $prev_post = get_adjacent_id_smart(true); if(!empty($prev_post)): echo ‘not empty’; previous_post_smart(); else: echo ’empty’; endif; ?> And I got the behavior I was looking for, don’t know why the default WP function … Read more
You need to change into the code, by default wordpress shows only post which are published. In your case you need to change the $args = array( ‘post_status’ => array( ‘publish’, ‘draft’) ); $query = new WP_Query( $args ); for more info you can look into this link: Another thing you can alter your current … Read more
If you are asking about woocommerce, this function is located in woocommerce/templates/loop/results-count.php Here’s the full code, you will get the logic if you go through it. $paged = max( 1, $wp_query->get( ‘paged’ ) ); $per_page = $wp_query->get( ‘posts_per_page’ ); $total = $wp_query->found_posts; $first = ( $per_page * $paged ) – $per_page + 1; $last = … Read more
No, there shouldn’t be, but you may have other issues related to functionality in WordPress if plugins make assumption. SEO concerns the frontend output of your site, the internal data structure isn’t directly relevant as Google doesn’t look inside your database
You should start with tutorials on web to convert HTML5 to WordPress. The steps are too exhaustive to be covered in an answer here. However, here’s a link for you to get started. Also, don’t forget to check out WordPress Codex, the documentation which will guide you through WP functions, standards & APIS.
Go to Settings > Permalinks and set your permalink structure to /%postname%.php. Simples.
I’m afraid I don’t understand the question perfectly, so I apologize, but, $post_status=”publish”; Wouldn’t that do it? I am missing context though, are you building a query? Because to get all the posts by the current user, something like this would be needed: $args = array( “post_status” => “publish”, “author” => get_current_user_id(), “posts_per_page” => 10 … Read more
That’s indeed a basic PHP question. Use strpos(). Example: if ( false !== strpos( $post->post_content, ‘foo’ ) ) { wp_enqueue_script(); } Ps. I suggest you to not hook into wp_enqueue_scripts() but a later hooks, e.g. the_content and then load the JavaScript in the footer. This works best under all circumstances as wp_enqueue_scripts and wp_head are … Read more
What happen if you proceed with the following syntax? <div id=”container”> <?php if( have_posts() ) : while( have_posts() ) : the_post(); ?> <article id=”post-<?php the_ID(); ?>” <?php post_class(); ?>> <h2 class=”entry-title”><?php the_title(); ?></h2> <div class=”entry-content”> <?php the_content(); ?> </div> </article > <!– /#post-<?php the_post_ID(); ?> –> <?php endwhile; endif; ?> </div> <!– /#container –> The … Read more