Single page site + pushState?

I did something similar to this on einsteinworld.com. The way I did it was to use a function in functions.php to get and render the content, then I called the same function from single.php or via ajax depending on the scenario. Like that you can either use the global $post for direct navigation to the … Read more

How to display single post from custom post type loop?

Your single.php is coded in a way that show all posts like archive, it needs to be modified. To fetch current post, try something like that instead: <?php get_header(); ?> <section id=”content”> <div class=”wrap-content blog-single”> <?php while ( have_posts() ) : the_post(); ?> <article id=”post-<?php the_ID(); ?>” <?php post_class(); ?>> <?php the_title( ‘<h1>’,'</h1>’ ); ?> … Read more

Add & store extra fields – WordPress Comments

Turns out Advanced Custom Fields, a plugin I was already using, makes it super easy to insert additional fields into the comment form. ACF is so good that it has created a tutorial to do just this and how to output the data within the comment thread: https://www.advancedcustomfields.com/resources/get-values-comment/ However, by doing this the plugin adds … Read more

Is it possible to create rel=”noindex, nofollow” for a single post if contain bad keywords?

<head> <meta charset=”<?php bloginfo( ‘charset’ ); ?>”> <meta name=”viewport” content=”width=device-width, initial-scale=1″> <link rel=”profile” href=”http://gmpg.org/xfn/11″> <?php if (is_single()){ //add more keywords in regex code $badWords = array(“badwords”,”badkeyword”); $string = get_the_content(); $matches = array(); $matchFound = ”; $matchFound = preg_match_all(“/\b(” . implode($badWords,”|”) . “)\b/i”,$string,$matches); } ?> <meta name=”robots” content=”index,follow <?php echo $matchFound ?>” /> <?php wp_head() ?> … Read more

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