Count the number of matching post names in foreach loop

I would get the count of a variable number of repeated titles by using an indexed array. $theposts = get_posts( array( ‘post_type’ => ‘post_subscriber’, ‘post_status’ => ‘publish’, ‘numberposts’ => -1, ) ); // project titles counter, outside the loop $project_titles = array(); foreach( $theposts as $p ): $project_name = get_post_meta($p->ID, ‘project’, true); echo ‘<ol>’; echo … Read more

Link on post title only if post have content

Based on this question Probably the easiest way would be: <?php // The Loop while (have_posts()) : the_post(); ?> <?php if (” !== get_post()->post_content): ?> <h2><a href=”<?php the_permalink() ?>” rel=”bookmark” title=”Permanent Link to <?php the_title_attribute(); ?>”><?php the_title(); ?></a></h2> <?php else: ?> <h2><?php the_title(); ?></h2> <?php endif; ?> <div><p> <?php if (get_field(‘telefono’)): ?>Telefono: <?php the_field(‘telefono’); ?> … Read more

How can I remove paginated SEO titles from my WordPress site?

I’ve fixed the problem with this code: <title> <?php global $page, $paged; wp_title(‘|’, true, ‘right’); bloginfo(‘name’); $site_description = get_bloginfo(‘description’, ‘display’); if ($site_description && (is_home() || is_front_page())) echo ” | $site_description”; if ($paged >= 2 || $page >= 2) echo ‘ | ‘ . sprintf(__(‘Sayfa %s’, ‘twentyten’), max($paged, $page)); ?> </title>

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