How to create sidebar from “scratch”?

Technically “off topic” here as your actual question is open-ended and there is lots of room for opinion. https://wordpress.stackexchange.com/help/dont-ask Sidebars and widgets are a perfect way to organize these elements. Keep in mind these are simply tools to organize blocks for repeated use in various locations. So, officially, my answers to your two questions are: … Read more

Make widget with media upload repeatable

Naive repeatable are impossible with widgets as the data structure and UI tend to be rigid. On the face of it, the way you describe it in the question, you can just use the media library to select multiple images instead of one, and keep them as a list of attachment IDs. You should take … Read more

Create a new recent post widget

My widget was like this: public function __construct() { $widget_ops = array( ‘classname’ => ‘yggdrasil_widget_recent_entries’, ‘description’ => __( ‘Your site’s most recent Posts.’ ), ‘customize_selective_refresh’ => true, ); parent::__construct( ‘recent-posts’, __( ‘Recent Posts’ ), $widget_ops ); $this->alt_option_name=”yggdrasil_widget_recent_entries”; } Below works as a new widget without overriding the default wordpress recent posts public function __construct() { … Read more

Before_widget won’t show up

Thanks to Tom J Nowell I found out that the reason for after_widget and before_widget NOT appearing was that I used my own widget and inside my own widget I had commented out: //echo $args[‘before_widget’]; and //echo $args[‘after_widget’]; So as soon as I tested it with the default wordpress “Custom HTML” everything worked fine and … Read more

Adding pagination to my theme [closed]

$supernews_cat_post_args = array( ‘posts_per_page’ => $supernews_number, ‘no_found_rows’ => true, ‘post_status’ => ‘publish’, ‘ignore_sticky_posts’ => true ); This is the code where you should add the pagination. Changing it to: $paged = ( get_query_var( ‘paged’ ) ) ? get_query_var( ‘paged’ ) : 1; $supernews_cat_post_args = array( ‘posts_per_page’ => $supernews_number, ‘no_found_rows’ => true, ‘post_status’ => ‘publish’, ‘ignore_sticky_posts’ … Read more

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