- NewspaperPosts Loop Element
- NewspaperFlex Block Builder and Flex Loop Builder
- Apitd_api_category_top_posts_style::update_key
- Apitd_api_category_top_posts_style::update
- Apitd_api_category_top_posts_style::add
- NewspaperBookmark – Save For Later
- NewspaperModules Builder in Newspaper Theme
- NewspaperFilters and sorting for taxonomies
- NewsmagPage templates
- NewspaperPage templates
- NewspaperSmart Sidebar
- NewspaperChild Theme Support
- ApiAPI – Thumbnail – Introduction
- ApiAPI – Category top section style – Introduction
Hi everyone,
Is there a way to use custom post template for specific post category?
I did like this:
Created function in functions.php which gets post slug and tries to find file single-{slug}.php.
If such file exists it uses it for template.
As in Newspaper theme post templates are not formed in usual way (as default WordPress does) I cannot find the right code to paste in single-{slug}.php. I just need it to work correctly like loop-single.php template.
I see, that template is formed from header->header-style->loop-single files. But when I try to combine the code inside single-{slug}.php it breaks the layout.
Of course I can keep searching for bugs and finally fix them, but maybe it is some other … more easy way to make it work.
I don’t know if it matters, I’m using childtheme.
Thank in advance.
Just to add to this I’m using this shortcode <?php echo do_shortcode(‘[td_block_12 limit=”4″ custom_title=”More Stories” td_filter_default_txt=”All” ajax_pagination=”infinite”]’);?> at the bottom of the loop-single-2.php. I want to insert ads in this block after every 4 posts. Thanks
Hi Guys
Trying to insert ads after every 4 posts in block12 using the infinite loading, can you point me to the correct loop as I have tried adding the code as described here https://forum.tagdiv.com/topic/insert-ads-between-posts-in-latest-articles/. But the infinite load in block 12 doesn’t seem to use the same loop any ideas on how I can achieve this.
Thanks
Art
Limit queries on home page, but mostly on post pages …
e.g., limit loops used in sidebar; use only 3 related items bottom of page, not 50; don’t use loops/queries in menu bar, or only use one.
Turn off the comment counter on posts/comment it out.
Stuff like that … helps!
Hi:
After activating the WordPress Related Posts https://wordpress.org/plugins/wordpress-23-related-posts-plugin/ the Newspaper theme panel doesn’t work well, for example: selecting Custom Typography and clicking on any option keeps showing the “loading” animation in infinite loop.
Is there anything that can be done to fix it?
Thank you!
Hi,
Unfortunately the category page template can’t be built via VC page builder therefore you can’t use blocks there as blocks can be added via page builder only or as widgets on sidebars.
You could do this by alter the category template and adding a condition as “when category X is called” your custom layout and blocks load instead of the loop posts or besides them. You can use the do_shortcode() functions to add the block on the category page and customize them via VC page builder.
Other way would be to use the page builder and create the page using VC then add a menu item and set the custom page to it.
Either way this would not be easy and you’d need custom modifications to theme’s code so I suggest you get a freelancer or hire a developer to do this for you if you don’t know how to do it by yourself.
Thanks
Hi,
I guess that you want to do this only for post template 8. If want this please edit loop-single-8.php and comment or delete related posts: http://screencast.com/t/Tm81NBEtcH
If this is not what you mean please provide more details.
Thanks!
Well, there is finite number of files in your theme folder root?
Maybe look at one of the “single” files for the single post, which is how WordPress refers to posts.
Perhaps … loop-single.php ?
Note the section
<div class="meta-info">
<?php echo $td_mod_single->get_author();?>
<?php echo $td_mod_single->get_date(false);?>
<?php echo $td_mod_single->get_views();?>
<?php echo $td_mod_single->get_comments();?>
</div>
then perhaps, in the /includes/modules/ folder …
say, maybe you’re using td_module_5.php
note the section
<div class="meta-info">
<?php echo $this->get_author();?>
<?php echo $this->get_date();?>
<?php echo $this->get_comments();?>
</div>
Great to go “exploring” in the files, as it’s pretty simple to change some basic stuff by locating the stuff based on logical naming structure.
Hope that helps 🙂
-
This reply was modified 11 years by
simchris.
Just for those who tend not to look at changelog, I’ve gone ahead and posted that here, for those who need it — since I was just looking at that myself.
ALSO: suggestion, use my “moving to newsmag” sticky as process for updating theme to minimize the change of “white screen of doom” or the server 500 issue (stupid Visual Composer!!!!) 😉
===================
[ Version 1.6 ]
– fix: when you have background color on site, the color disappear on post style 6
– fix: the two strings that where not translated properly
– fix: arrow list shortcode
– fix: issue with page template options on sites that did not use the english language
– fix: featured image placeholders now work as expected again
– fix: hide and show category label panel setting
– fix: search icon click on affix was going back to top
– fix: excerpt not working for trending now
– fix: excerpt missing for mega menu title
– fix: links that contained only #_and_something did not work
– fix: https issue on backend. TinyMCE font was loaded via HTTP
– fix: astpect ration for vimeo videos
– fix: missing translation
– improvement: better top bar settings
– improvement: social icons moved in their own panel in backend
– improvement: better footer panel with better text and better organization
– improvement: better woocommerce 2.3 compatibility
– improvement: faster category page, the system that pulls the subcategories uses two less queries
– improvement: removed width of the top bar for better spacing
– improvement: removed the texture from parallax templates (prevent flickering)
– new: footer template system
– new: category template system + category top post style template. Currently we do not deliver any new templates but this system paves the way for easy user customizations via plugins and it also allows us to add new styles.
– new: when subcategories don’t fit in the category page, the theme will make a drop down with the excess categories
– new: RGBA color picker in panel. You can now use colors with alpha blending (transparency) on all the elements of the theme that support colors
VISUAL COMPOSER
28.01.2015 – ver 4.4.2
– Extra CSS class can be used in grid elements now
– Single image styles fixed
– added action “vc_load_default_templates_action”
– vc_add_default_templates() fixed
– Added compatibility for older Layer slider
– Background disappearing in row on child element deleting fixed
– Message box backwards compatibility added
– Grid builder ajax stability improved
– Css tpl for Design options regenerated
– Custom query in Grid builder handles correctly ampersand and quote marks
– Compatibility with jwplayer improved
– Compatibility with ACF improved
===================================
Here is a list of all the changes between v 1.5 and v 1.6
===================================
Modified files – 83 files
•category.php
•footer.php
•functions.php
•header.php
•includes\js_files\td_main.js
•includes\less_files\category.less
•includes\less_files\footer.less
•includes\less_files\header.less
•includes\less_files\menu-header.less
•includes\less_files\page.less
•includes\less_files\pagebuilder\shortcodes\blocks.less
•includes\less_files\post-templates.less
•includes\less_files\pulldown-filter.less
•includes\less_files\type.less
•includes\less_files\woocommerce.less
•includes\modules\td_module_mx1.php
•includes\modules\td_module_single.php
•includes\modules\td_module_trending_now.php
•includes\plugins\td-social-counter.zip
•includes\plugins\td-speed-booster.zip
•includes\shortcodes\td_block_big_grid.php
•includes\shortcodes\td_block_mega_menu.php
•includes\shortcodes\td_block_trending_now.php
•includes\td_config.php
•includes\td_css_generator.php
•includes\wp_booster\td_autoload_classes.php
•includes\wp_booster\td_block.php
•includes\wp_booster\td_block_widget.php
•includes\wp_booster\td_css_buffer.php
•includes\wp_booster\td_global.php
•includes\wp_booster\td_global_blocks.php
•includes\wp_booster\td_module.php
•includes\wp_booster\td_page_generator.php
•includes\wp_booster\td_social_icons.php
•includes\wp_booster\td_util.php
•includes\wp_booster\td_wp_booster_functions.php
•includes\wp_booster\wp-admin\content-metaboxes\td_set_post_settings.php
•includes\wp_booster\wp-admin\content-metaboxes\td_set_reviews.php
•includes\wp_booster\wp-admin\content-metaboxes\td_set_smart_list.php
•includes\wp_booster\wp-admin\css\panel\controls.less
•includes\wp_booster\wp-admin\css\panel\navigation.less
•includes\wp_booster\wp-admin\css\wp-admin.css
•includes\wp_booster\wp-admin\css\wp-admin.less
•includes\wp_booster\wp-admin\images\panel\panel-icons\ico-ads.png
•includes\wp_booster\wp-admin\images\panel\panel-icons\ico-analytics.png
•includes\wp_booster\wp-admin\images\panel\panel-icons\ico-back.png
•includes\wp_booster\wp-admin\images\panel\panel-icons\ico-background.png
•includes\wp_booster\wp-admin\images\panel\panel-icons\ico-block.png
•includes\wp_booster\wp-admin\images\panel\panel-icons\ico-categories.png
•includes\wp_booster\wp-admin\images\panel\panel-icons\ico-color.png
•includes\wp_booster\wp-admin\images\panel\panel-icons\ico-css.png
•includes\wp_booster\wp-admin\images\panel\panel-icons\ico-excerpts.png
•includes\wp_booster\wp-admin\images\panel\panel-icons\ico-footer.png
•includes\wp_booster\wp-admin\images\panel\panel-icons\ico-header.png
•includes\wp_booster\wp-admin\images\panel\panel-icons\ico-post.png
•includes\wp_booster\wp-admin\images\panel\panel-icons\ico-responsive.png
•includes\wp_booster\wp-admin\images\panel\panel-icons\ico-template.png
•includes\wp_booster\wp-admin\images\panel\panel-icons\ico-translation.png
•includes\wp_booster\wp-admin\images\panel\panel-icons\ico-typography.png
•includes\wp_booster\wp-admin\images\panel\panel-icons\ico-welcome.png
•includes\wp_booster\wp-admin\js\td_wp_admin.js
•includes\wp_booster\wp-admin\panel\td_panel.php
•includes\wp_booster\wp-admin\panel\td_panel_generator.php
•includes\wp_booster\wp-admin\panel\views\ajax_boxes\td_panel_block_settings\td_thumbs_on_modules_and_blocks.php
•includes\wp_booster\wp-admin\panel\views\ajax_boxes\td_panel_categories\td_get_category_section_by_id.php
•includes\wp_booster\wp-admin\panel\views\ajax_boxes\td_panel_translations\td_translations.php
•includes\wp_booster\wp-admin\panel\views\td_panel_block_settings.php
•includes\wp_booster\wp-admin\panel\views\td_panel_categories.php
•includes\wp_booster\wp-admin\panel\views\td_panel_excerpts.php
•includes\wp_booster\wp-admin\panel\views\td_panel_footer.php
•includes\wp_booster\wp-admin\panel\views\td_panel_header.php
•includes\wp_booster\wp-admin\panel\views\td_panel_post_settings.php
•includes\wp_booster\wp-admin\panel\views\td_panel_template_settings.php
•includes\wp_booster\wp-admin\tinymce\tinymce.php
•loop.php
•parts\header\header-menu.php
•parts\header\top-menu.php
•parts\header\top-widget.php
•parts\page-category-big-grid.php
•parts\page-category-header.php
•single.php
•style.css
•td_less_editor-style.php
New files – 105 files
•images\panel\category_templates\icon-category-1.png
•images\panel\category_templates\icon-category-2.png
•images\panel\category_templates\icon-category-top-1.png
•images\panel\category_templates\icon-category-top-2.png
•images\panel\footer_templates\icon-footer-1.png
•images\panel\footer_templates\icon-footer-2.png
•images\panel\footer_templates\icon-footer-3.png
•images\panel\footer_templates\icon-footer-4.png
•images\panel\footer_templates\icon-footer-5.png
•images\panel\footer_templates\icon-footer-6.png
•images\panel\footer_templates\icon-footer-7.png
•images\panel\footer_templates\icon-footer-8.png
•images\panel\footer_templates\icon-footer-9.png
•images\panel\modules\td_module_1.png
•images\panel\modules\td_module_10.png
•images\panel\modules\td_module_11.png
•images\panel\modules\td_module_12.png
•images\panel\modules\td_module_13.png
•images\panel\modules\td_module_14.png
•images\panel\modules\td_module_15.png
•images\panel\modules\td_module_2.png
•images\panel\modules\td_module_3.png
•images\panel\modules\td_module_4.png
•images\panel\modules\td_module_5.png
•images\panel\modules\td_module_6.png
•images\panel\modules\td_module_7.png
•images\panel\modules\td_module_8.png
•images\panel\modules\td_module_9.png
•images\panel\single_templates\single_template_1.png
•images\panel\single_templates\single_template_2.png
•images\panel\single_templates\single_template_3.png
•images\panel\single_templates\single_template_4.png
•images\panel\single_templates\single_template_5.png
•images\panel\single_templates\single_template_6.png
•images\panel\single_templates\single_template_7.png
•images\panel\single_templates\single_template_8.png
•images\panel\single_templates\single_template_default.png
•images\panel\smart_lists\td_smart_list_1.png
•images\panel\smart_lists\td_smart_list_2.png
•images\panel\smart_lists\td_smart_list_3.png
•images\panel\smart_lists\td_smart_list_4.png
•images\panel\smart_lists\td_smart_list_default.png
•includes\block_templates\td_block_template_1.php
•includes\category_templates\td_category_template_1.php
•includes\category_templates\td_category_template_2.php
•includes\category_top_posts_styles\td_category_top_posts_style_1.php
•includes\category_top_posts_styles\td_category_top_posts_style_2.php
•includes\modules\td_module_mx5.php
•includes\modules\td_module_mx6.php
•includes\modules\td_module_mx_empty.php
•includes\wp_booster\external\kint\composer.json
•includes\wp_booster\external\kint\config.default.php
•includes\wp_booster\external\kint\decorators\concise.php
•includes\wp_booster\external\kint\decorators\plain.php
•includes\wp_booster\external\kint\decorators\rich.php
•includes\wp_booster\external\kint\Kint.class.php
•includes\wp_booster\external\kint\LICENCE
•includes\wp_booster\external\kint\parsers\custom\arrayobject.php
•includes\wp_booster\external\kint\parsers\custom\classmethods.php
•includes\wp_booster\external\kint\parsers\custom\classstatics.php
•includes\wp_booster\external\kint\parsers\custom\color.php
•includes\wp_booster\external\kint\parsers\custom\json.php
•includes\wp_booster\external\kint\parsers\custom\microtime.php
•includes\wp_booster\external\kint\parsers\custom\splfileinfo.php
•includes\wp_booster\external\kint\parsers\custom\splobjectstorage.php
•includes\wp_booster\external\kint\parsers\custom\timestamp.php
•includes\wp_booster\external\kint\parsers\custom\xml.php
•includes\wp_booster\external\kint\parsers\parser.class.php
•includes\wp_booster\external\kint\README.md
•includes\wp_booster\external\kint\scripts\source.reg
•includes\wp_booster\external\kint\scripts\source.vbs
•includes\wp_booster\external\kint\view\inc\kint.js
•includes\wp_booster\external\kint\view\inc\original.css
•includes\wp_booster\external\kint\view\inc\solarized-dark.css
•includes\wp_booster\external\kint\view\inc\solarized.css
•includes\wp_booster\external\kint\view\js\_kint.js
•includes\wp_booster\external\kint\view\less\original.less
•includes\wp_booster\external\kint\view\less\solarized-dark.less
•includes\wp_booster\external\kint\view\less\solarized.less
•includes\wp_booster\external\kint\view\less\_kint.less
•includes\wp_booster\external\kint\view\trace.phtml
•includes\wp_booster\external\kint\_main.php
•includes\wp_booster\td_block_template.php
•includes\wp_booster\td_category_template.php
•includes\wp_booster\td_category_top_posts_style.php
•includes\wp_booster\td_css_inline.php
•includes\wp_booster\td_module_single_base.php
•includes\wp_booster\wp-admin\css\panel\color_picker.less
•includes\wp_booster\wp-admin\images\panel\panel-icons\ico-social.png
•includes\wp_booster\wp-admin\js\td_edit_page.js
•includes\wp_booster\wp-admin\js\td_wp_admin_color_picker.js
•includes\wp_booster\wp-admin\panel\views\td_panel_social_networks.php
•js\site.min.js
•js\tagdiv_theme.js
•js\tagdiv_theme.min.js
•parts\footer\td_footer_extra.php
•parts\footer\td_footer_template_1.php
•parts\footer\td_footer_template_2.php
•parts\footer\td_footer_template_3.php
•parts\footer\td_footer_template_4.php
•parts\footer\td_footer_template_5.php
•parts\footer\td_footer_template_6.php
•parts\footer\td_footer_template_7.php
•parts\footer\td_footer_template_8.php
•parts\footer\td_footer_template_9.php
Deleted files – 50 files
•.idea\.name
•.idea\encodings.xml
•.idea\misc.xml
•.idea\modules.xml
•.idea\Newsmag.iml
•.idea\scopes\scope_settings.xml
•.idea\vcs.xml
•.idea\workspace.xml
•includes\modules\td_module_big_grid.php
•includes\wp_booster\td_api.php
•includes\wp_booster\wp-admin\images\panel\footer-1.png
•includes\wp_booster\wp-admin\images\panel\footer-2.png
•includes\wp_booster\wp-admin\images\panel\footer-3.png
•includes\wp_booster\wp-admin\images\panel\footer-4.png
•includes\wp_booster\wp-admin\images\panel\module-1.png
•includes\wp_booster\wp-admin\images\panel\module-10.png
•includes\wp_booster\wp-admin\images\panel\module-11.png
•includes\wp_booster\wp-admin\images\panel\module-12.png
•includes\wp_booster\wp-admin\images\panel\module-13.png
•includes\wp_booster\wp-admin\images\panel\module-14.png
•includes\wp_booster\wp-admin\images\panel\module-15.png
•includes\wp_booster\wp-admin\images\panel\module-2.png
•includes\wp_booster\wp-admin\images\panel\module-3.png
•includes\wp_booster\wp-admin\images\panel\module-4.png
•includes\wp_booster\wp-admin\images\panel\module-5.png
•includes\wp_booster\wp-admin\images\panel\module-6.png
•includes\wp_booster\wp-admin\images\panel\module-7.png
•includes\wp_booster\wp-admin\images\panel\module-8.png
•includes\wp_booster\wp-admin\images\panel\module-9.png
•includes\wp_booster\wp-admin\images\panel\module-mx1.png
•includes\wp_booster\wp-admin\images\panel\module-mx2.png
•includes\wp_booster\wp-admin\images\panel\module-mx3.png
•includes\wp_booster\wp-admin\images\panel\module-search.png
•includes\wp_booster\wp-admin\images\post-templates\post-templates-icons-0.png
•includes\wp_booster\wp-admin\images\post-templates\post-templates-icons-1.png
•includes\wp_booster\wp-admin\images\post-templates\post-templates-icons-2.png
•includes\wp_booster\wp-admin\images\post-templates\post-templates-icons-3.png
•includes\wp_booster\wp-admin\images\post-templates\post-templates-icons-4.png
•includes\wp_booster\wp-admin\images\post-templates\post-templates-icons-5.png
•includes\wp_booster\wp-admin\images\post-templates\post-templates-icons-6.png
•includes\wp_booster\wp-admin\images\post-templates\post-templates-icons-7.png
•includes\wp_booster\wp-admin\images\post-templates\post-templates-icons-8.png
•includes\wp_booster\wp-admin\images\post-templates\smart-list-0.png
•includes\wp_booster\wp-admin\images\post-templates\smart-list-1.png
•includes\wp_booster\wp-admin\images\post-templates\smart-list-2.png
•includes\wp_booster\wp-admin\images\post-templates\smart-list-3.png
•includes\wp_booster\wp-admin\images\post-templates\smart-list-4.png
•js\td_site.js
•js\td_site.min.js
•parts\footer\column-1.php
—————-
New files – 105 files
•images\panel\category_templates\icon-category-1.png
•images\panel\category_templates\icon-category-2.png
•images\panel\category_templates\icon-category-top-1.png
•images\panel\category_templates\icon-category-top-2.png
•images\panel\footer_templates\icon-footer-1.png
•images\panel\footer_templates\icon-footer-2.png
•images\panel\footer_templates\icon-footer-3.png
•images\panel\footer_templates\icon-footer-4.png
•images\panel\footer_templates\icon-footer-5.png
•images\panel\footer_templates\icon-footer-6.png
•images\panel\footer_templates\icon-footer-7.png
•images\panel\footer_templates\icon-footer-8.png
•images\panel\footer_templates\icon-footer-9.png
•images\panel\modules\td_module_1.png
•images\panel\modules\td_module_10.png
•images\panel\modules\td_module_11.png
•images\panel\modules\td_module_12.png
•images\panel\modules\td_module_13.png
•images\panel\modules\td_module_14.png
•images\panel\modules\td_module_15.png
•images\panel\modules\td_module_2.png
•images\panel\modules\td_module_3.png
•images\panel\modules\td_module_4.png
•images\panel\modules\td_module_5.png
•images\panel\modules\td_module_6.png
•images\panel\modules\td_module_7.png
•images\panel\modules\td_module_8.png
•images\panel\modules\td_module_9.png
•images\panel\single_templates\single_template_1.png
•images\panel\single_templates\single_template_2.png
•images\panel\single_templates\single_template_3.png
•images\panel\single_templates\single_template_4.png
•images\panel\single_templates\single_template_5.png
•images\panel\single_templates\single_template_6.png
•images\panel\single_templates\single_template_7.png
•images\panel\single_templates\single_template_8.png
•images\panel\single_templates\single_template_default.png
•images\panel\smart_lists\td_smart_list_1.png
•images\panel\smart_lists\td_smart_list_2.png
•images\panel\smart_lists\td_smart_list_3.png
•images\panel\smart_lists\td_smart_list_4.png
•images\panel\smart_lists\td_smart_list_default.png
•includes\block_templates\td_block_template_1.php
•includes\category_templates\td_category_template_1.php
•includes\category_templates\td_category_template_2.php
•includes\category_top_posts_styles\td_category_top_posts_style_1.php
•includes\category_top_posts_styles\td_category_top_posts_style_2.php
•includes\modules\td_module_mx5.php
•includes\modules\td_module_mx6.php
•includes\modules\td_module_mx_empty.php
•includes\wp_booster\external\kint\composer.json
•includes\wp_booster\external\kint\config.default.php
•includes\wp_booster\external\kint\decorators\concise.php
•includes\wp_booster\external\kint\decorators\plain.php
•includes\wp_booster\external\kint\decorators\rich.php
•includes\wp_booster\external\kint\Kint.class.php
•includes\wp_booster\external\kint\LICENCE
•includes\wp_booster\external\kint\parsers\custom\arrayobject.php
•includes\wp_booster\external\kint\parsers\custom\classmethods.php
•includes\wp_booster\external\kint\parsers\custom\classstatics.php
•includes\wp_booster\external\kint\parsers\custom\color.php
•includes\wp_booster\external\kint\parsers\custom\json.php
•includes\wp_booster\external\kint\parsers\custom\microtime.php
•includes\wp_booster\external\kint\parsers\custom\splfileinfo.php
•includes\wp_booster\external\kint\parsers\custom\splobjectstorage.php
•includes\wp_booster\external\kint\parsers\custom\timestamp.php
•includes\wp_booster\external\kint\parsers\custom\xml.php
•includes\wp_booster\external\kint\parsers\parser.class.php
•includes\wp_booster\external\kint\README.md
•includes\wp_booster\external\kint\scripts\source.reg
•includes\wp_booster\external\kint\scripts\source.vbs
•includes\wp_booster\external\kint\view\inc\kint.js
•includes\wp_booster\external\kint\view\inc\original.css
•includes\wp_booster\external\kint\view\inc\solarized-dark.css
•includes\wp_booster\external\kint\view\inc\solarized.css
•includes\wp_booster\external\kint\view\js\_kint.js
•includes\wp_booster\external\kint\view\less\original.less
•includes\wp_booster\external\kint\view\less\solarized-dark.less
•includes\wp_booster\external\kint\view\less\solarized.less
•includes\wp_booster\external\kint\view\less\_kint.less
•includes\wp_booster\external\kint\view\trace.phtml
•includes\wp_booster\external\kint\_main.php
•includes\wp_booster\td_block_template.php
•includes\wp_booster\td_category_template.php
•includes\wp_booster\td_category_top_posts_style.php
•includes\wp_booster\td_css_inline.php
•includes\wp_booster\td_module_single_base.php
•includes\wp_booster\wp-admin\css\panel\color_picker.less
•includes\wp_booster\wp-admin\images\panel\panel-icons\ico-social.png
•includes\wp_booster\wp-admin\js\td_edit_page.js
•includes\wp_booster\wp-admin\js\td_wp_admin_color_picker.js
•includes\wp_booster\wp-admin\panel\views\td_panel_social_networks.php
•js\site.min.js
•js\tagdiv_theme.js
•js\tagdiv_theme.min.js
•parts\footer\td_footer_extra.php
•parts\footer\td_footer_template_1.php
•parts\footer\td_footer_template_2.php
•parts\footer\td_footer_template_3.php
•parts\footer\td_footer_template_4.php
•parts\footer\td_footer_template_5.php
•parts\footer\td_footer_template_6.php
•parts\footer\td_footer_template_7.php
•parts\footer\td_footer_template_8.php
•parts\footer\td_footer_template_9.php
==============================
by tagDiv 2014 🙂 | http://tagdiv.com | Our portfolio
Hey Guys,
I am using pagination for my posts , and using the default template loop-single.php
what I would like to achieve is to have a piece of code for header Ad ( <?php echo do_shortcode(‘[td_ad_box spot_id=”header”]’); ?> ) to only show on the first page above the featured image , and I don’t want it to show on the second and third pages (where the featured image doesn’t show) …
so basically I want to tie up the header Ad to show and hide with the featured image ..
Again , I am using the default post Template and happy to play with code if you provide me with guidance ..
Cheers
Wissam
<!– Style compiled by theme –>
<style>
.td-menu-header .td-sp,
.sf-sub-indicator{
background-image: url(‘http://cdn.rnbjunk.com/wp-content/themes/Newspaper/images/header/elements-menu.png’);
}
@media only screen and (-webkit-min-device-pixel-ratio: 2),
only screen and (-moz-min-device-pixel-ratio: 2),
only screen and (min-device-pixel-ratio: 2) {
.td-menu-header .td-sp, .sf-sub-indicator{
background-image: url(‘http://cdn.rnbjunk.com/wp-content/themes/Newspaper/images/header/elements-menu@2x.png’);
}
}
</style>
<!– JS generated by theme –>
<script>
var td_blocks = []; //here we store all the items for the current page
//td_block class – each ajax block uses a object of this class for requests
function td_block() {
this.id = ”;
this.block_type = 1; //block type id (1-234 etc)
this.atts = ”;
this.td_cur_cat = ”;
this.td_column_number = ”;
this.td_current_page = 1; //
this.post_count = 0; //from wp
this.found_posts = 0; //from wp
this.max_num_pages = 0; //from wp
this.is_ajax_running = false;
this.header_color = ”;
this.ajax_pagination_infinite_stop = ”; //show load more at page x
}
var td_ad_background_click_link=””;
var td_ad_background_click_target=””;
var td_ajax_url=”http://www.rnbjunk.com/wp-admin/admin-ajax.php”;
var td_get_template_directory_uri=”http://www.rnbjunk.com/wp-content/themes/Newspaper”;
var tds_snap_menu=”snap”;
var tds_header_style=””;
var tds_mobile_swipe=””;
var td_search_url=”http://www.rnbjunk.com/search/”;
var td_please_wait=”Please wait…”;
var td_email_user_pass_incorrect=”User or password incorrect!”;
var td_email_user_incorrect=”Email or username incorrect!”;
var td_email_incorrect=”Email incorrect!”;
var tds_more_articles_on_post_enable=””;
var tds_more_articles_on_post_time_to_wait=””;
var tds_more_articles_on_post_pages_distance_from_top=”0″;
var tds_theme_color_site_wide=”#4db2ec”;
</script>
<script type=”text/javascript”>
/* <![CDATA[ */
var wpNotesIsJetpackClient = true;
/* ]]> */
</script>
</head>
<body class=”home page page-id-41827 page-template page-template-page-homepage-loop page-template-page-homepage-loop-php logged-in admin-bar no-customize-support td-full-layout wpb-js-composer js-comp-ver-4.4.2 vc_responsive”>
Now It’s better. but the color is blu. My question is, can i change colors in a easier way bypassing that panel?
Soooo close. For some reason it still shows just below the breadcrumbs, but I think we’re ok with that.
Just in case they change their mind, do I need to change something else so the breadcrumbs are underneath?
Thanks again!
<?php
/**
* The single post loop - This shows only one post
**/
if (have_posts()) {
the_post();
$td_mod_single = new td_module_1($post);
echo do_shortcode('[td_ad_box spot_id="custom_ad_1"]');
//show the breadcrumb
if (get_post_type($post) == 'post') {
echo td_page_generator::get_single_breadcrumbs($td_mod_single->title);
} else {
echo td_page_generator::get_page_breadcrumbs($td_mod_single->title);
}
?>
How to add a post slider, on the home page? (block big_grid)
I understand here?
in “loop-single.php” – related and big-grid:
</article> <!-- /.post -->
<?php echo $td_mod_single->related_posts();?>
and
----> <?php echo $td_block_big_grid-> how to correctly write? ();?>
To display the last posts, how on the main page.
Hi,
> It will appear on every post, but the theme comes with multiple styles for posts. If you don’t change it you could edit only the loop-single.php and ignore the rest.
> Please send an email at contact@tagdiv.com , paste a link to this conversation and provide wp-admin access so i can take a look.
Thanks!
Hi,
You can try this solution:
1. Edit td_module.php like this : http://screencast.com/t/KjLPzbsDBxE
Code that you have to paste on else condition: http://pastebin.com/zCaDGebT
2. Change called function for modules(all modules or just that for blocks that are you using): http://screencast.com/t/1RpccM0g
Result: http://screencast.com/t/6h7ft9GqB
You can change it also for posts(or leave with that function by default get_date) if you want, by editing loop-single or single_template depending of post template that you want to use: http://screencast.com/t/6dDaUdWjb7
Result: http://screencast.com/t/ajtzdwDKjxf
Thanks!
Hi!
That line is no on the file – Please advice!
<?php
/**
* Category page BIG GRID
*
* the way it works
*
* - if the current current category have posts then display those posts
* - if the current category does't have posts then check the subcategories of this (current category)
* - if the subcategories have posts then those posts will be displayed
* - if the subcategories does't have posts then an empty area will be displayed
*
* - if the current category does't have post or subcategories then, the area where the subcategories links will be displayed + the area of the big grid will be removed
*
**/
//category list
// $global_flag_to_hide_no_post_to_display - is a flag to hide the 'No posts to display' message if on category page there are between 1 and 5 posts
global $cur_cat_obj, $loop_sidebar_position, $loop_module_id, $cur_cat_id, $paged, $global_flag_to_hide_no_post_to_display, $wp_query ;
$buffy = '';
//get the option to show or not the big grid
$td_disable_big_grid = td_util::get_category_option($cur_cat_id, 'tdc_slider');
//get the link of this category
$category_link = get_category_link($cur_cat_id);
//if we are on a cat without subcats
$td_cat_without_subcats = 0;
//the subcategories
if (!empty($cur_cat_obj->cat_ID)) {
$td_sub_cats = get_categories(array(
'parent' => $cur_cat_obj->cat_ID,
'hide_empty' => 0
));
//if the current category dose't have subcategories then get all the categories from the same level as current category
if (empty($td_sub_cats)) {
$td_cat_without_subcats = 1;
if($cur_cat_obj->category_count == 0) {
$td_disable_big_grid = 'yes';
}
//exclude uncategorized category
$Obj_cat_uncategorized = get_category_by_slug('uncategorized');
$id_cat_uncategorized = $Obj_cat_uncategorized->term_id;
//exclude featured category
$Obj_cat_featured = get_category_by_slug('featured');
$id_cat_featured = $Obj_cat_featured->term_id;
$td_sub_cats = get_categories(array(
'parent' => $cur_cat_obj->parent,
'exclude' => array($id_cat_uncategorized, $id_cat_featured),
'hide_empty' => 0
));
}
}
if (!empty($td_sub_cats)) {
$buffy = '<div class="td-category-header">';
$buffy .= '<ul class="td-category td-category-page-subcats">';
foreach ($td_sub_cats as $td_sub_cat) {
if (!empty($td_sub_cat->name) and td_util::get_category_option($td_sub_cat->cat_ID,'tdc_hide_on_post') != 'hide') {
$tax_meta_subcat_color = td_util::get_category_option($td_sub_cat->cat_ID, 'tdc_color');
$td_cat_color = '';
/* if (!empty($tax_meta_subcat_color)) {
$td_cat_color = ' style="background-color:' . $tax_meta_subcat_color . ';"';
} else { */
if($td_cat_without_subcats == 1 and $td_sub_cat->cat_ID == $cur_cat_id) {
$td_cat_color = ' style="background-color:#222222;color:#ffffff;"';
}
/*} */
$buffy .= '<li class="entry-category">cat_ID) . '">' . $td_sub_cat->name . '';
}
}
$buffy .= '';
$buffy .= '<div class="clearfix"></div>';
$buffy .= '</div>';
}
//get the filter_by URL ($_GET) variable
$filter_by = get_query_var('filter_by');
$td_category_big_grid_drop_down_filter_options = array(
array('id' => 'latest', 'value' => $category_link, 'caption' => __td('Latest')),
array('id' => 'featured' , 'value' => add_query_arg('filter_by', 'featured', $category_link), 'caption' => __td('Featured posts')),
array('id' => 'popular', 'value' => add_query_arg('filter_by', 'popular', $category_link), 'caption' => __td('Most popular')),
array('id' => 'popular7' , 'value' => add_query_arg('filter_by', 'popular7', $category_link), 'caption' => __td('7 days popular')),
array('id' => 'review_high' , 'value' => add_query_arg('filter_by', 'review_high', $category_link), 'caption' => __td('By review score')),
array('id' => 'random_posts' , 'value' => add_query_arg('filter_by', 'random_posts', $category_link), 'caption' => __td('Random'))
);
// is a flag to hide the 'No posts to display' message if on category page there are between 1 and 5 posts
$global_flag_to_hide_no_post_to_display = '';
//this flag is checked in the loop.php file to hide the No posts to display message if we have the big grid on the page and there are between 1 and 5 posts
$global_flag_to_hide_no_post_to_display = $wp_query->post_count;
//if there are post to display add also the drop down category filter
if($td_disable_big_grid != 'yes') {
echo $buffy;
//create the drop-down filter on category pages
echo td_util::generate_category_pull_down($td_category_big_grid_drop_down_filter_options, $filter_by);
//print_r($global_flag_to_hide_no_post_to_display);
//only show the big grid on first page
if($paged < 2) {
//parameters to filter to for big grid
$atts_for_big_grid = array(
'limit' => '5',
'category_id' => $cur_cat_id
);
//add the sorting option to the big_grid
if(!empty($filter_by)) {
$atts_for_big_grid['sort'] = $filter_by;
}
//show the big grid
echo td_global_blocks::get_instance('td_block_big_grid')->render($atts_for_big_grid);
}
}
Hello, i want to replace default wordpress comment system with facebook comments,
i have already research on this forum for facebook comment, i saw some people recommended this plugin:
https://wordpress.org/plugins/facebook-comments-plugin/
i have tried install it and i tried to use it via php tag in loop-single-7.php
<?php echo $td_mod_single->related_posts();?>
<?php echo do_shortcode('[fbcomments][fbcomments url="http://peadig.com/wordpress-plugins/facebook-comments/" width="100%" count="off" num="3" countmsg="wonderful comments!"]'); ?>
comment box was showing but it was showing twice itself!

Also how to disable original default comment box?
5. You can add a block to an individual row and set margin/border to the column: http://screencast.com/t/AlOEmZ9psE
For widgets you have to use custom css.
6. If you refer to the Latest Articles sidebar will be the same on all pages. The Theme doesn’t have an option for that area, it’s only possible with custom modifications on the code but unfortunately it’s not an easy task.
7. The theme was initially designed with an fixed grid layout and changing it would not be easy as it needs changing the width value for all elements on pages and for this you would need custom work, so the full width will hide the sidebar automatically.
8. You have to modify the template (404.php), you can check the other templates (post, pages) to see how the sidebar is defined.
9. Please edit type.less to change font for quotes in Panel: http://screencast.com/t/t5MpFmFpt
In backend the quotes have color of the Theme, how you can see that in the less file. Also you can change that in what color you want.
10. You can change the Latest posts number from Homepage Loop Filter:
http://screencast.com/t/c94aDRWFp6h
http://screencast.com/t/XDP3mHWtyZ
Or leave that field empty and change the number from Settings > Reading: http://screencast.com/t/dcAgP2WPWN
11. Google adsense should not load, do you refer to something else? please provide more details.
Thanks!
I think somebody else did this awhile back, but the theme (and, well, WordPress), don’t work this way by default. I’m not sure how you would modify that to load “specific” posts within the loop, although one might imagine it could be done by “page order number” and you could then set the order on each page, to have one be the main, then second, then third, etc.
I know somebody else asked about this over the past year, but you’d have to suffer the search tool, and most people don’t bother to “tag” their posts to help finding stuff easier.
Thank you for excellent product. I want to add and realise only one idea on this theme – Post rating by users. I found many plugins with user rating system but they can show Most rated posts only at sidebar widget. Please tell me, can I modify current or add new sort order to Homepage Loop Filter? Now I’m using WP-PostRatings and I saw many completed queries at their FAQ.
Hi,
The latest are section is the same as a blog page and it’s added into the template using the loop so it’s independent from the page builder above.
What you could do is to use a template without that sections and use a block to create it. Of course it will not look and function in the same way but will be the best approach for your needs so you can use a block set a number of posts from all categories, the latest articles sort order, give it a title like “latest articles” and set the pagination to load more or next/prev..
Hope this helps!
Thanks
Hi,
Please add your code in Theme Panel > Ads > Custom ad like this: http://screencast.com/t/Qg2O2uBdtdu
After that you can use do_shortcode function to place it in template:
-in loop-single.php add <?php echo do_shortcode('[td_ad_box spot_id="custom_ad_2"]'); ?> before related posts like this: http://screencast.com/t/1IhB9MmYQlX
-in single.php add echo do_shortcode('[td_ad_box spot_id="custom_ad_1"]'); after comments like this: http://screencast.com/t/nSsLlE92gYQ
Result: http://screencast.com/t/JqIpqZ5r
I don’t know why, but your code is loaded only once.
Hope this helps!
-
This reply was modified 11 years by
Alin [tagDiv].
-
This reply was modified 11 years by
Alin [tagDiv].
-
This reply was modified 11 years by
Alin [tagDiv].
Hi,
Sorry for the inconvenience caused and sorry for the delay we have somehow missed your post and this topic.
Replace the code in loop.php file with this one: http://pastebin.com/LJXRekQC like this: http://screencast.com/t/kvN5y5mXr
This will render the ad code you have in custom ad 1 section and will add that ad after 2 and 4 posts.
Hope this helps!
Thanks
Hi,
You can use shortcodes and add the plugin shortcode directly into posts’s template using the do_shortcode function. You need to edit the loop-single.php file and add it above the title like this or replace our social sharing: http://screencast.com/t/JV4sz8Lzhn
You can disable the theme’s social sharing buttons from theme panel: http://screencast.com/t/42dPYTOMC1
Thanks
-
This reply was modified 11 years by
Lucian.
Hi,
You can use shortcodes and add the items directly into posts’s template using the do_shortcode function. You need to edit the loop-single.php file and add the items you want above the title like this: http://screencast.com/t/G89bn6ykN
You can do use the do_shortcode function like this: https://forum.tagdiv.com/topic/how-to-create-attachment-page-like-this-in-newsmag/#post-31168
Thanks
