Building theme so user can change header image [closed]

You can add theme support in your functions file for a Custom Header page using this code which also enables you to add a default size and selector class which you can style with CSS. add_theme_support( ‘custom-header’, array( ‘width’ => 320, ‘height’ => 60, ‘header-selector’ => ‘.site-title a’, ‘header-text’ => false ) ); Or this … Read more

why is this content-template not showing any of my blog-entries?

With this code: get_template_part(‘content’, ‘page’ ); WordPress will try to load a file called content-page.php and if this file doesn’t exist then it will try to load content.php. Your theme seems to have the file content-page.php, so if you want to load content.php you should use: get_template_part(‘content’); EDIT: You have edited the question and delete … Read more

Fake Single WordPress Post (Page) Loop

How about something like this instead: add_action(‘template_redirect’, function(){ get_header(); echo ‘page stuff’; get_footer(); exit(); }); add_filter(‘the_title’, function(){ return “Virtual Page Title”; }); What you are trying to do strikes me as very prone to error. Different themes can do all kinds of different things with page.php, not to mention that it may not be present … Read more

If i have custom post type with 5 custom fields do i have to create a new loop to reference each one?

For all intents and purposes, you only need one loop. While s_ha_dum’s comment is correct, odds are since you’re asking this question, you won’t have a need for multiple loops. <? get_header(); ?> <? if(have_posts()): while(have_posts()): the_post(); ?> <!–Your content here, like so–> <div id=”content”> <? the_field(‘body_content’); ?> <? the_field(‘footer_content’); ?> </div> <? endwhile; endif; … Read more

Fallback if statement based on the number filtered from it

Got some help from a friend and figured out that I needed to move the post_meta stuff into the query with meta_query then just set a fallback from there. <?php $current_date = date(‘Ymd’); $page_object = get_queried_object(); $page_id = get_queried_object_id(); // Match the string “123” to the database value a:1:{i:0;s:3:”123″;} (serialized array) for ACF $page_id = … Read more

query_posts ignores the argument

Don’t use query_posts this will alter your main loop, you can query posts by day 1-31 using WP-Query(); $day = date(‘j’); $args = array( ‘day’ => $day); $day_query = new WP_Query($args); if ($day_query->have_posts()) : while ($day_query->have_posts()) : $day_query->the_post(); //show posts endwhile; wp_reset_postdata(); endif;

‘all’ hook and add_action issue (class based plugin)

First, template_redirect is a front end hook. It never fires on your backend save. You need to choose a backend hook such as admin_init to hook your function. Secondly, based on your pastebin from you other question, your code has the checked attribute hard-coded for both of your radio boxes, thus causing it to default … Read more

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