Why does WP_Post not contain its permalink?

WP_Post is a representation of the post as it exists in the database, and the permalink isn’t stored in the database. It’s not stored in the database because it’s not a property of the post. The permalink is determined by the site’s address, its permalink structure, and the post’s slug. Imagine if updating the permalink … Read more

hiding permalink in admin if the user is subscriber

maybe this can do the trick? (untested). Note I used contributor role (Thanks to Brian Fegter for pointing this out) function my_remove_meta_boxes() { if (current_user_can(‘contributor’)) { remove_meta_box(‘slugdiv’, ‘post’, ‘normal’); } } add_action( ‘admin_menu’, ‘my_remove_meta_boxes’ );

Stop Images Linking to Themselves?

To change the default for images (so you don’t have to choose “none” on the image links to checkboxes every time you insert an image into a post), you can go to yoursite.com/wp-admin/options.php; find the image_default_link_type option, and change the value from “file” to “none”.

Pagination for blog posts reloading same page [closed]

$my_query = new WP_Query( array( ‘posts_per_page’ => 3, ‘paged’ => get_query_var(‘paged’) ) ); while ( $my_query->have_posts() ) : $my_query->the_post(); the_title(); // more stuff here endwhile; wp_pagenavi( array( ‘query’ => $my_query ) ); wp_reset_postdata(); try this code and also increase the size of show posts in SETTINGS->Reading->Blog pages show at most 10 to 50 or 100, … Read more

Permalinks settings

I’m not able to visit either link successfully. I get a redirect loop error: ERR_TOO_MANY_REDIRECTS Changing the URL of your website in Settings > General > Site URL is not enough unfortunately. You will still have your post content with your sub domain URL (clasificados.example.com) causing your website to not load properly. Once you’ve downloaded … Read more

Retrieve post ID from “querying” URL

Try This Code $latest = new WP_Query( array ( ‘post_type’ =>’your-post-type-name’, ‘post_status’ =>’publish’, ‘orderby’ => ‘rand’, ‘posts_per_page’ => 3 )); while ( $latest -> have_posts() ) : $latest -> the_post(); echo the_ID(); endwhile;

Custom rewrite rule ignored

The rewrite rules are correct, but because you are modifying the $wp_rewrite directly, you aren’t getting the benefit of being able to add the rule to the top of the stack using add_rewrite_rules. You are on the right track with the location of the rule in the array, but rules at the top are checked … Read more