Articles of posts

Is it possible to change the admin posts per page view?

In the admin panel (backend) when you go to “posts” it shows you a pagination (in my case with 29 posts per page). Is it possible to change to posts per page number for a specific post type? Thanks.

Linking to pages/posts within the site

I’m trying to add links to my posts. How can I link to my pages where I don’t have to use the domain but only the pathway? Default: http://domain.com/post-title Change to: /post-title I once had a client who had this functionality on her WP site.

Wrap every month posts in div

I have a code which wraps every 4 posts in div. How can I adapt it to wrap every month posts in div. <?php $args = array( ‘post_type’ => ‘posts’, ‘posts_per_page’ => -1, ‘order’ => ‘DESC’ ); $the_query = new WP_Query($args); if ($the_query->have_posts()) : $counter = 0; while ($the_query->have_posts()) : $the_query->the_post(); if ($counter % 4 […]

How to add a class to each individual post?

I’ve finally figured out how the post loop works (very new to coding), and I’m trying to figure out the best way to add a class to individual posts I’m displaying (title, author, etc when I add all of them) in the following code: $args = array( ‘numberposts’ => ‘5’ ); $recent_posts = wp_get_recent_posts( $args […]

the_content() Not Grabbing All Content

I’m having a weird issue where WordPress is cutting off and not grabbing all of the content from pages or posts. Examples can be seen on the following pages: About Staying In Tune During The Off Season Here is what the code looks like for single.php <?php get_template_part(‘parts/header’); the_post(); ?> <main> <div class=”singleContainer”> <article id=”post-<?php […]

Manually removing revision post types

I’m trying to clean and optimize my WordPress database, and I’m wondering if it’s safe to write a MySQL script that would purge/delete all revision post types from the wp_posts table and run it periodically via cron job. Would it also be safe to then reorder post IDs by post date to reflect the now-deleted […]

Adding bootstrap classes to video shortcodes

I want to make videos responsive… There is a function in /wp-includes/media.php file: line 2497: $html_atts = array( ‘class’ => apply_filters( ‘wp_video_shortcode_class’, ‘wp-video-shortcode’ ), ‘id’ => sprintf( ‘video-%d-%d’, $post_id, $instance ), ‘width’ => absint( $atts[‘width’] ), ‘height’ => absint( $atts[‘height’] ), ‘poster’ => esc_url( $atts[‘poster’] ), ‘loop’ => wp_validate_boolean( $atts[‘loop’] ), ‘autoplay’ => wp_validate_boolean( $atts[‘autoplay’] […]

store posts_id of category into a varable?

I have ten posts in my query that belong in three categories: cat-a,cat-b,cat-c. I’m looking for a way to store $posts_ids from each category into a variable. Say for example, if three posts are in “category-a” then store those posts_ids in a variable. Cat-a Post 1 ID->435 Post 2 ID->477 Post 3 ID->488 $idcata = […]

Indirect modification of overloaded property WP_Post::$ancestors has no effect

After updating my WordPress to the latest version, I’m getting the error below: Indirect modification of overloaded property WP_Post::$ancestors has no effect <ul id=”mainwalker”> <?php if(!$post->post_parent){ $children = wp_list_pages(array( ‘sort_column’ => ‘menu_order’, ‘title_li’ => ”, ‘echo’ => 1, ‘walker’ => new Sidebar_Custom_Walker() )); }else{ if($post->ancestors) { $ancestors = end($post->ancestors); $children = wp_list_pages(array( ‘sort_column’ => ‘menu_order’, […]

Displaying posts that belong to a specific author

I am a drupal developer who is trying help out a friend with this task. I have a custom team post that has all the team members of the company and they sometimes post an article about their cases. If the user creates a post it gets a link of: and I want to direct […]