wordpress show category link instead of post link [closed]

in the loop-entry.php there is <h2><a href=”https://wordpress.stackexchange.com/questions/295028/<?php the_permalink(” ‘) ?>” title=”<?php the_title(); ?>”><?php the_title(); ?></a></h2> change above code to <h2><a href=”https://wordpress.stackexchange.com/questions/295028/<?php echo get_permalink( $post->ID ); ?>” title=”<?php the_title(); ?>”><?php the_title(); ?></a></h2> Done!

Weird query with get_posts and WP_Query

I just tried to replicate your code and the only issue I came up with is in one of the arguments to your CPT setup. You have “capability_type” => “comunicado”, But this prevented the CPT working correctly for me. I don’t think this argument should be referring to itself. I replaced it with ‘post’ to … Read more

query_posts works while get_posts doesn’t

Every page has a “main query” which is run before the template is loaded. The results of the main query are how WordPress determines what template to load. The standard Loop operates on the data contained in the main query, this is why it seems to just magically “work” without you having to explicitly query … Read more

how to ask if in two categorys inside if

You can specify multiple categories within has_category like so: if ( has_category( array( ‘category_1’, ‘category_2’ ) ) { // do something } However, I am not sure if this acts as AND or OR, meaning does it require that ALL categories specified are matched, or one of the X supplied (category_1 OR category_2). In any … Read more

Efficiently loop over huge number of posts

Call a external script: Your function look like this: <?php function modify_posts() { $number_posts = 10; $offset = 0; $success=”success”; while ( ‘success’ === $success ) { $url = add_query_arg( array( ‘num’ => $number_posts, ‘off’ => $offset, ‘abs’ => urlencode( ABSPATH ) ), plugins_url( ‘remote_get.php’, __FILE__ ) ); $response = wp_remote_get( $url ); if ( … Read more

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