Return only certain (html)-elements of the_content()

There are two ways to achieve it. $args = array( ‘post_type’ => ‘post’, ‘posts_per_page’=>1 ); $mj_query = new WP_Query( $args ); By the_expcerpt(), You can use excerpt field to display the content for post listing page.You can enable excerpt field by screen option through current post edit page.Just put html element to that excerpt field … Read more

Populate an array from the loop, and then read the array into JS

It’s because you’re running the localize script inside the loop. Instead, store the array of ids etc, and then run localize script outside/after you set it up. All the localize script really does is inject the params you pass into it into the global scope of js/jquery, allowing you to reference them. However, localize script … Read more

“Page Array” displaying in title bar on Front Page

There are many ways to set page title in wordpress. 1) In admin area go to settings >> General Settings. Set “Site Title” field and “Tagline” field values. 2) You can set your page title using wp_title() function to set the title of your page. Using this function you can change your page title based … Read more

Show content by using tags

in case someone else in searching for this, I used a WP Query with the statement tag: $args = array (myargs1,….,myargsn); for ($i=0; $i<count($args);$i++){ $query = new WP_Query( array( ‘tag’ => $args[$i] ) ); …and so on with if have_posts() and a while loop, you can find the whole syntax on wordpress.org, only thing i … Read more