Hot answers tagged

5

That's easy. You have the following CSS rule: a.themify_lightbox, .module-image a, .module-gallery a, .gallery-icon, .themify_lightboxed_images .post a, .themify_lightboxed_images .type-page a, .themify_lightboxed_images .type-highlight a, .themify_lightboxed_images .type-slider a { pointer-events: none; cursor: default; } This rule ...


3

I think you could get around this by pre-running the shortcodes on the page by applying the content filters before the header is output. This should allow any internal shortcodes run inside the included post to add any action hooks properly and thus any needed stylesheets/resources. add_action('wp_loaded','maybe_prerun_shortcodes'); function ...


3

This may be a silly idea, but it might work: 1 Let your shortcode explode to an iframe with a custom query_var (tutorial). Like this: <iframe src="http://www.example.com/?p=123&my_query_var=content_only"></iframe> 2 In your single.php detect the query_var and in that case skip visual header, sidebars, footer - anything not connected to ...


2

set_post_thumbnail_size() (and other API functions which add/change sizes) applies to generation while it's active. So existing generated image sizes won't be retroactively affected by it. There are plenty of tools around (plugins, wp-cli) which regenerate files with current sizes configuration.


2

Firstly i would say this is off-topic here as it purely relates to css/js, but let me try to give some pointers. Here you markup is : <article> <header></header> <div> .... <p><img class="align-center" src="path/to/img1"></p> .... <p><img class="align-center" ...


2

Do you understand the bootstrap framework at all? Your theme has implemented a column width that is smaller than you would probably like. Your content area is wrapped in an offset column that is 50% of the container width. <div class="col-lg-6 col-lg-offset-3"> <!-- content --> </div> If you want to increase the width of your ...


2

You're doing well - just one thing you need to change, and I reckon it's a totally reasonable mistake to make: This: add_action('wp_enqueue_styles', 'alpha_styles'); needs to become add_action('wp_enqueue_scripts', 'alpha_styles'); Why scripts? Because there is no Wordpress action called wp_enqueue_styles. Although the functions are named ...


2

Load visual compose css function get_visual_composer_style($id) { return '<style>' . get_post_meta( $id, '_wpb_shortcodes_custom_css', true ) . '</style>'; } Load css based on shortcode function custom_shortcode_scripts() { global $post; if( is_a( $post, 'WP_Post' ) && has_shortcode( ...


2

The closest to a reference technique in core would be [gallery] shortcode. If you look at the source of implementing gallery_shortcode() function you'll see that it: Generates instance number (so multiple shortcodes can be distinguished). Outputs dynamic CSS inline into a page source, for each instance. I wouldn't consider it particularly neat solution, ...


2

It says right there in the code: <?php // to use a image just replace the bloginfo('name') with your img src and remove the surrounding <p> ?> So just replace this line below that comment: <p id="logo" class="h1" itemscope itemtype="http://schema.org/Organization"><a href="<?php echo home_url(); ?>" rel="nofollow"><?php ...


2

You should mention register function in your Question. Add flush_rewrite_rules( false ); in Your custom_post_type register function. it is necessary when you are creating custom post with archive. example code: function create_my_post_type(){ register_post_type('MyPost', array( 'labels' => array('name' ...


1

Wordpress has absolutely nothing to do with responsiveness, neither does themes or plugins. Responsiveness is controlled by media queries (CSS) set in stylesheets and the particular browser the site is viewed in. It is here where screen sizes are determined and checked against available media query rules. Just one note, older browsers like IE6, 7 and 8 does ...


1

It's all down to the theme and possibly any elements on your page that are generated by plugins, which are hard for theme authors to anticipate sometimes.


1

You have a spelling mistake in your CSS. .commentlist should be .comment-list


1

You can also try <span class="<?php echo get_post_format($post->ID); ?>"></span> Additional details available here Edited from here: Well according to the link I provided, get_post_format() give you the post format post the post_type post. So if you want to use it in loop, you could try while ( have_posts() ) : the_post(); echo ...


1

You should use WordPress's built in function wp_enqueue_style for loading styles. /** * Proper way to enqueue scripts and styles */ function wpdocs_theme_name_scripts() { wp_enqueue_style( 'style-name', get_stylesheet_uri() ); wp_enqueue_script( 'script-name', get_template_directory_uri() . '/js/example.js', array(), '1.0.0', true ); } ...


1

Well it seems you are using ACF. The you need not echo the_field() only echo get_field('')


1

It is mostly matter of personal preference how to structure this. The typical approaches are: CSS import (used to be popular, but considered kind of meh now); enqueue parent stylesheet as dependency and customize with rules in your stylesheet (more files, less trouble); copy parent stylesheet into child completely either once or repeatedly via build tools ...


1

In your function.php you can add a custom size, for example: add_image_size ('custom_thumbail', 200, 200); Then once you regenerate thumbnails (recommended plugin by wordpress) it will create these, or any new uploaded images will have this size. Then you can call them in your post. Echo wp_get_attachment_url('your post id', 'custom_thumbail'); ...


1

I use the Aqua Resizer in my theme development. https://github.com/syamilmj/Aqua-Resizer It's pretty easy to implement, and it should do exactly what you want. This function will allow you to resize any existing WordPress image. The below example would create a 200 x 200 image from the WP Medium image, and hard crop it to 200 x 200. $thumb = ...


1

Only to append the solution from @luis-sanz, I will add the note that every theme has to have the style.css file enqueued. Following the example https://codex.wordpress.org/Function_Reference/wp_add_inline_style from the codex, we can use get_stylesheet_uri() function and append the dynamic CSS data using the wp_add_inline_style function in the following ...


1

wp_add_inline_style needs to be tied to an existing stylesheet in order to work properly. The inline styles will only be printed when the stylesheet they are attached to is enqueued. This is quite handy to control the scope of the inline styles. If the idea is to have them printed globally, the safest handle to tie them to is that of the active theme main ...


1

It should look like this: .page-id-2557 section#title { background: none !important; } This removes the image, then you may want to change the color of the title Which you'd have to also use !important, since this theme uses !important a lot, which isn't great... try to avoid. .page-id-2557 #title.title-area .title-content .title-text h1 { color: ...


1

Just override the background property with the below code in your child css. #title { background: none !important; }



Only top voted, non community-wiki answers of a minimum length are eligible